express-ws icon indicating copy to clipboard operation
express-ws copied to clipboard

setTimeout() implementation contradicts API documentation

Open krayon007 opened this issue 8 years ago • 0 comments

When you call ws._socket.setTimeout(), it correctly emits the timeout event after the specified amount of idle timeout, however, it also closes the websocket, which is contrary to the API documentation for net.socket, which which says that the socket will NOT be closed.

When an idle timeout is triggered the socket will receive a 'timeout' event but the connection will not be severed. The user must manually call socket.end() or socket.destroy() to end the connection.

krayon007 avatar Jun 07 '17 00:06 krayon007