uWebSockets.js icon indicating copy to clipboard operation
uWebSockets.js copied to clipboard

app.close()

Open ghost opened this issue 4 years ago • 3 comments

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)

ghost avatar Jul 31 '21 18:07 ghost

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.

ghost avatar Sep 12 '21 15:09 ghost

Not required I keep Maps/Sets of sockets

e3dio avatar Sep 12 '21 20:09 e3dio

I'd like to add my support for this request. Overall less boilerplate in Node-land. Less code, less bugs, easier maintainability.

bugs181 avatar Oct 09 '21 08:10 bugs181