Comment #15 on issue 2254 by [email protected]: keepalive support and cleanup for client-initiated connections as per RFC 5626
http://code.google.com/p/mobicents/issues/detail?id=2254

http://java.net/projects/jsip/lists/cvs/archive/2011-01/message/3

Thanks for the pointer!

Jean, I'm a little bit concerned about the following line:

if(nbytes == 4 && "\r\n\r\n".equals(new String(msg, 0, nbytes)))

TCP and TLS don't have to obey message boundaries, so there is no guarantee that all four bytes will be delivered together. The logic may fail if you receive, e.g., "\r\n\r", not detect it as a ping, and push the bytes further to the pipeline.

SipConnector.setKeepAliveTimeout(address, port, timeout)
SipConnectorListener.onKeepAliveTimeout(connector, address, port)
SipConnector.closeReliableConnection(address, port)

Yes, this seems like a viable approach - an alternative approach where the stack, not the app, is responsible for tracking connection timeouts. I think it will work for us, too. For completeness, I would like to have a way to reset the timeout - e.g. setKeepAliveTimeout(address, port, 0), and a getter - getKeepAliveTimeout(address, port).

Reply via email to