Hi Guys.
I'm just approaching Ai2 environment and I need help on using ClientSocketAi2Ext. I need to maintain an open connection with a server that send back to the client spontaneous events in json format. I experienced that if I change screen and than come back to the main screen, I do not receive anymore events. I need to "reconnect" to the server, but on server side I noted that the previous connection is still open, so there are two active connection. Of Course if I change the screen again, come back and then reconnect again, it works, but I have 3 active connection running, and so no.
I dont' know how exactly it work, but it seems like in the screen changes I lost the reference instance of the first original socket connection and the event handler is not able anymore to receive the data.
unfortunately I cannot close the connection before change the screen and then reopen it when initialize main screen, because the extension has probably a bug in "disconnect" method, that results in a crash of the app (and, for what I googled, there is no strong support on the extension)
Is there any way to "save" the original socket reference? Any suggestion how I can solve ?
thanks in advance.
Fabrizio