Skip to content

Commit

Permalink
Merge branch 'haxe-remoting-fixes' into rpc-error-responses
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Hampson committed Nov 9, 2009
2 parents af707a9 + 5316274 commit 08d6c0d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
13 changes: 9 additions & 4 deletions www/haxe_sample.html
@@ -1,11 +1,16 @@
// To try this sample out using haXe and neko,
// save this file as Application.hx and run the following to compile it:
// haxe Application -neko Application.n -main Application.hx
// and the following to execute it:
// neko Application.n
class Application {

public static function main():Void {
var URL = "http://localhost:8000/haxe_sample.yaws";
var cnx = haxe.remoting.AsyncConnection.urlConnect(URL);
cnx.onError = function(err) {
var cnx = haxe.remoting.HttpAsyncConnection.urlConnect(URL);
cnx.setErrorHandler( function(err) {
trace("Exception : " + Std.string(err));
};
} );
var a = {a:"foo", b:"bar", c:[1,2,3]};
var b = "hello, Erlang!";
cnx.echo.call([a, b], display);
Expand All @@ -14,4 +19,4 @@
static function display(v) {
trace(v);
}
}
}
1 change: 1 addition & 0 deletions www/haxe_sample.yaws
@@ -1,4 +1,5 @@
<erl module=haxe_sample>
-export([respond/2]).

out(A) ->
A1 = A#arg{state = {new_state, "alive and kicking"}},
Expand Down

0 comments on commit 08d6c0d

Please sign in to comment.