I just realized that TCP networking isn't that easy as of now using haxe/nme, since there are two main implementations:
However, sys.net.Socket goes the plain synchronous way, so you'd have to call .connect and wait until it's done connecting. It blocks the current thread.
On the other hand, flash.net.Socket uses the more beautiful event-driven way, whereas you call connect and can continue on with other code, and as soon as it's done connecting it will call a specified callback.
I'm planning on creating one simple event-driven Solution that works on both platforms with the same codebase. This may be done using Multithreading on the C++ target, thus being able to do connect etc. on secondary threads and avoid blocking the main thread.
The text was updated successfully, but these errors were encountered: