We created a WebSocket between a browser (Chrome) and Mobicents ApacheTomcat Application Server. When network gets disconnected we expected to for our onClose() method to be called at some point now that the connection has been compromised. In the meantime we are going to implement ping-pong type of messaging but since WebSocket rides on TCP and it has its keep alive mechanism already there should be no need to do anything outside of it. Please advise and let me know if you need any additional information.
Which WebSocket implementation? Which connector? Depending on circumstances, Tomcat may not be informed of the network disconnection - in which case there is no way for Tomcat to call onClose().
I seem to recall markt doing some work on this recently: you (Mark) weren't able to replicate a network drop by disconnecting your VMs network, but physically pulling the Ethernet cable from your laptop seemed to do the trick. Could this have been fixed /post/ 7.0.50?
Thanks Chris. I hadn't joined up those dots. *** This bug has been marked as a duplicate of bug 57546 ***
(In reply to Mark Thomas from comment #3) > Thanks Chris. I hadn't joined up those dots. > > *** This bug has been marked as a duplicate of bug 57546 *** FTR, bug #57546 was fixed in 7.0.59. Please upgrade and re-test.
Sorry for late replay but update emails were caught in my spam :-) Just wanted to add that actually we did many tests and found out that TCP keep alive timers are only good between the "hops" and not end to end. So, implementing some sort of Ping/Pong mechanism one level higher seems to be the only way to verify if the two ends can still talk to each other or not. The test: I have connected a Chrome client running on a laptop and called into my conferencing application running on ApacheTomcat. When connection was established after about 40 seconds I disconnected the network on the laptop and noticed that websocket was not notified that it was closed. If I attempted to send something to it at that moment then it will tell me that websocket no longer exists. Changing TCP keepalive timers on AS I could see them going back and forth from AS out and back... but did not see them on the client machine at all. That is what made me believe that these timer settings are only between the network hops.