node-ssdp icon indicating copy to clipboard operation
node-ssdp copied to clipboard

Server.stop() fails to wait for 'bye' to complete before killing sockets.

Open troppoli opened this issue 5 years ago • 0 comments

The server.stop call does three things without any synchronization: sends out a bye stops the advertise loop closes sockets

The trouble is that _stop (closing sockets) is called without waiting for _send's callback to complete. So you will see the 'Sending a message to %s:%s' from _send, but you will don't see the 'Outgoing server message' from the completion in advertise. If I put a breakpoint before _stop, this message usually makes it out when I run.

I'm on win 10 with multiple NICs

troppoli avatar Oct 30 '18 18:10 troppoli