I'd like to propose a change to the Receiver.close() function. The underlying Socket.close() function accepts an optional callback which gets called when the socket is eventually closed.
Since reconfiguring the receiver is not possible, we need to close it first, create a new instance and start it again.Although possible to reconfigure universes to listen to it would be nice to be able to wait for Socket.close(). As of now there is no possibility to wait for the socket to be closed, therefore when calling Receiver.start() on a new instance the port is still occupied (although using reuseAddr: true for that matter...).
This could also be implemented using events but since Socket.close() already offers that feature I figured that would be the easiest way.
I'd like to propose a change to the
Receiver.close()
function. The underlyingSocket.close()
function accepts an optional callback which gets called when the socket is eventually closed.Since reconfiguring the receiver is not possible, we need to close it first, create a new instance and start it again.Although possible to reconfigure universes to listen to it would be nice to be able to wait forSocket.close()
. As of now there is no possibility to wait for the socket to be closed, therefore when callingReceiver.start()
on a new instance the port is still occupied (although usingreuseAddr: true
for that matter...).This could also be implemented using events but since
Socket.close()
already offers that feature I figured that would be the easiest way.