Closed schrodit closed 11 months ago
The linked documentation is for the master branch. The documentation for the 7.5.9 version (https://github.com/websockets/ws/blob/7.5.9/doc/ws.md#serverclosecallback) correctly states that connections are automatically closed.
Thanks for pointing me to the correct docs. Didn't noticed that the linked code was also for 7.x.
Is there an existing issue for this?
Description
The docs state for WebSocket Server close function that
Existing connections are not closed automatically
.But the docs are contrary to the actual behavior of the server: When the WebSocket server is closed, all connected clients are terminated. See the code and a test for exactly that behavior.
So I'm wondering what is the expected behavior?
ws version
7.5.9
Node.js Version
v18.5.0
System
No response
Expected result
According to the docs, the client connection should not be closed when calling
WebSocketServer.close()
.Actual result
All client connections are terminated on
WebSocketServer.close()
Attachments
No response