I've run into strange problem in my Flex/Flashcom application. If client application unexpectedly disconnects from server latter does not call application.onDisconnect handler function. In witch direction should I look? Thank you.
Update I'm not using server components, but I do host this thing on Linux.
If so, it's documented and here an interesting forum to follow..basically on Linux it may work a bit crazy like :)
As mentioned by Artem Tikhomirov (the author of the question) in his own answer, my answer is not helpful (I keep there below as wiki, for archive).
The real answer has been given by Ric Tokyo regarding a bug on Linux, and is documented in this thread.
The only reason my answer is "chosen" is because Artem did not choose any other answer (or an answer of his own) before the 7 day limits, giving me (the first and most upvoted answer) half of the bounty points (75 over 150) automatically as explained in this SO blog entry.
First lead:
If the client is a component-base application, it needs to [handle connection events properly][9].
Then, you may want to check any error message in the Flash output panel, like:
That would indicate a server exception non-taken into account by the client, forcing an unexpected exit.
If the client read a stream from the server, it must make sure:
A good code would like this:
Since the new versions of FlashPlayer do propagate those kind of exception, they must be monitored and then catch in the client application
It's possible that a client is disconnected before the (Flash Media-) server 'knows' about this. So no 'onDisconnect' function gets invoked (it never gets called by the client) until very, very late.
If you want to detect (and act upon) "lingering" disconnects early, use the client.getStats() method.
I have this server-side actionscript example:
You can trigger and test this 'missing onDisconnect' behavior by removing the network cable from the connected Flash client.