express-ws
express-ws copied to clipboard
setTimeout() implementation contradicts API documentation
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.