I have an application where my clients need to receive data from a server. It's one way, the clients don't need to send data to the server. I've used the TCPSocket implementation to have my clients connect to the server directly. I followed this example: http://www.ape-project.org/wiki/index.php/TCPSocket I edited the socket.onread() event to call a function that updates my page with the latest data that is pushed to the client.
Everything works fine but I notice how some clients suddenly stop, and it seems like their connection is lost. I need to refresh the page for me to reconnect and have things working back to normal. I noticed the socket.onclose() doesn't seem to fire when this occurs. I want to be able to somehow catch when the connection is lost and try to do a re-connection. I did discover that error codes 004 and 250 were popping up in raw data that was being passed. I tried using the client.onError event for 004 and 250 but I don't know how to reset the socket. socket.close() does nothing, and when i try to do a socket.open nothing happens. What's the best way to capture disconnects and reestablish my connection to ensure a smooth connection for my clients? I'm also open to hear if there are better ways to implement this for my use case. Would love to hear from the community. Thanks! -- You received this message because you are subscribed to the Google Groups "APE Project" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/ape-project?hl=en --- APE Project (Ajax Push Engine) Official website : http://www.ape-project.org/ Git Hub : http://github.com/APE-Project/
