Prev | Current Page 795 | Next

L. McColl-Sylvester and F. Ponticelli

"Professional haXe and Neko"

urlConnect() No
Chapter 15: Putting It All Together with haXe Remoting
429
By default in a local connection, the remote methods invoked must be static methods or methods of
objects assigned to a static variable. In a remote connection, mainly for security reasons, the server must
explicitly register the objects that you intend to render available to the client.
Table 15 - 3 describes the static creational methods available to generate a Connection instance from the
haxe.remoting.Connection class. The returned type is always Connection and, thus, omitted.
One important thing to note is that when JavaScript or Flash acts as server, it does not have to implement
any specific code and it does not even need a main() method to start. The code must be simply
compiled starting from a script that imports the haxe.remoting.Connection class. Of course the
server code is really useful if there are methods and classes to invoke in there.
Flash - to - JavaScript Connection
An example of server - side code can be as simple as the following.


Pages:
783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807