Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 24 lines (21 sloc) 0.721 kb
5316274 Document how to run haXe remoting sample under neko
Paul Hampson authored
1 // To try this sample out using haXe and neko,
2 // save this file as Application.hx and run the following to compile it:
3 // haxe Application -neko Application.n -main Application.hx
4 // and the following to execute it:
5 // neko Application.n
1791e3d Added a haXe remoting adapter with documentation
Yariv Sadan authored
6 class Application {
7
8 public static function main():Void {
9 var URL = "http://localhost:8000/haxe_sample.yaws";
b10354c Update haxe remoting sample to current remoting API
Paul Hampson authored
10 var cnx = haxe.remoting.HttpAsyncConnection.urlConnect(URL);
11 cnx.setErrorHandler( function(err) {
1791e3d Added a haXe remoting adapter with documentation
Yariv Sadan authored
12 trace("Exception : " + Std.string(err));
b10354c Update haxe remoting sample to current remoting API
Paul Hampson authored
13 } );
1791e3d Added a haXe remoting adapter with documentation
Yariv Sadan authored
14 var a = {a:"foo", b:"bar", c:[1,2,3]};
15 var b = "hello, Erlang!";
16 cnx.echo.call([a, b], display);
48c117d Add example for haXe returning an error object
Paul Hampson authored
17 cnx.failure.call([a, b], display);
1791e3d Added a haXe remoting adapter with documentation
Yariv Sadan authored
18 }
19
20 static function display(v) {
21 trace(v);
22 }
5316274 Document how to run haXe remoting sample under neko
Paul Hampson authored
23 }
Something went wrong with that request. Please try again.