Errors are handled by wiring a proper function to the onError function of the
connection object. The onError() function is invoked each time an error occurs and the error message
is passed as argument.
Sometimes it is not possible to choose between synchronous and asynchronous because the
implementations are based on the native APIs that may not include every option.
Pull or Push?
A browser relies mainly on the HTTP protocol to exchange messages with the web servers. This is
considered a pull type communication because the client pulls the information out of the server.
The communication starts with the request and ends with the response. As soon as an answer is
received, the connection is broken . For web pages and small downloads in general, this is an optimal
solution because no resources are wasted in maintaining the channel of communication open when it
is unpredictable if this channel will be reused or not.
Chapter 15: Putting It All Together with haXe Remoting
427
The push technology works in a similar way because it is always the client that asks for a connection but
instead of closing the connection immediately with the first response, it is kept open to allow further
message exchanging.
Pages:
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802