uWebSockets.js
uWebSockets.js copied to clipboard
app.close()
Discussed in https://github.com/uNetworking/uWebSockets.js/discussions/575
Originally posted by e3dio July 10, 2021 call ws.end() on all sockets so don't need to keep Set of all sockets and loop through to close app also calls us_listen_socket_close?
app.close(code, message)
There is an internal list of sockets, but this list is not easily exposed and the fact you have to keep sockets in a set is not really a big deal. You can even keep them in a linked list if you want to, that is two pointers per socket.
It would be nice to have app.close, but currently it looks like this would need a new list internally either way.
Not required I keep Maps/Sets of sockets
I'd like to add my support for this request. Overall less boilerplate in Node-land. Less code, less bugs, easier maintainability.