Prev | Current Page 801 | Next

L. McColl-Sylvester and F. Ponticelli

"Professional haXe and Neko"

This can be useful when the remote
method returns Void .
Table 15 - 4 describes the static creational methods used to generate an AsyncConnection instance from
the haxe.remoting.AsyncConnection class. The returned type is always AsyncConnection and,
thus, omitted.
Both methods create connection for a remote kind of communication.
Table 15-4
AsyncConnection Creational Method Description
urlConnect(url:String) Used on any platform to connect to a Neko HTTP server.
The argument is the URL of the server.
amfConnect(gatewayUrl:String) Used in Flash to connect to an AMF Server. The argument
is the URL of the gateway service.
Chapter 15: Putting It All Together with haXe Remoting
433
JavaScript - to - Neko HTTP Server
To work with an asynchronous connection the client code can contain the optional data handling
function and it is advised to always wire an onError method to intercept communication errors. The
following code describes a connection from a JavaScript client code and a Neko HTTP server.
// content of client.


Pages:
789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813