You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wanted to see if I could set up Hapi to cleanly shut down all WebSocket connections when the server shuts down. hapi-plugin-websocket's behavior is confusing here; the source code comments make it sound like it intends to trigger a 'close' event on each connection:
However, the WebSocketServer.close method doesn't close existing connections. And, since client tracking is enabled, it doesn't even know what existing connections are there.
(To fully implement clean shutdowns, I believe I would need the ability to return a promise from the disconnect callback, so that it can asynchronously update the connection status in an external service - but that's a separate issue.)
The text was updated successfully, but these errors were encountered:
I wanted to see if I could set up Hapi to cleanly shut down all WebSocket connections when the server shuts down. hapi-plugin-websocket's behavior is confusing here; the source code comments make it sound like it intends to trigger a
'close'
event on each connection:hapi-plugin-websocket/hapi-plugin-websocket.js
Lines 353 to 364 in 84a11a6
However, the WebSocketServer.close method doesn't close existing connections. And, since client tracking is enabled, it doesn't even know what existing connections are there.
(To fully implement clean shutdowns, I believe I would need the ability to return a promise from the
disconnect
callback, so that it can asynchronously update the connection status in an external service - but that's a separate issue.)The text was updated successfully, but these errors were encountered: