Skip to content
This repository
Newer
Older
100644 23 lines (21 sloc) 0.721 kb
5316274e » TBBle
2009-11-09 Document how to run haXe remoting sample under neko
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
1791e3dc » Yariv Sadan
2006-06-27 Added a haXe remoting adapter with documentation
6 class Application {
7
8 public static function main():Void {
9 var URL = "http://localhost:8000/haxe_sample.yaws";
b10354ca » TBBle
2009-11-09 Update haxe remoting sample to current remoting API
10 var cnx = haxe.remoting.HttpAsyncConnection.urlConnect(URL);
11 cnx.setErrorHandler( function(err) {
1791e3dc » Yariv Sadan
2006-06-27 Added a haXe remoting adapter with documentation
12 trace("Exception : " + Std.string(err));
b10354ca » TBBle
2009-11-09 Update haxe remoting sample to current remoting API
13 } );
1791e3dc » Yariv Sadan
2006-06-27 Added a haXe remoting adapter with documentation
14 var a = {a:"foo", b:"bar", c:[1,2,3]};
15 var b = "hello, Erlang!";
16 cnx.echo.call([a, b], display);
48c117d9 » TBBle
2009-11-09 Add example for haXe returning an error object
17 cnx.failure.call([a, b], display);
1791e3dc » Yariv Sadan
2006-06-27 Added a haXe remoting adapter with documentation
18 }
19
20 static function display(v) {
21 trace(v);
22 }
5316274e » TBBle
2009-11-09 Document how to run haXe remoting sample under neko
23 }
Something went wrong with that request. Please try again.