Discovery Packets can not be sent due to this._udp being null
RoyalBingBong opened this issue · comments
For some reason, sending some discovery packets is taking a couple seconds before they actually go out and invoke the next one. This means if the discovery is stopped (via setTimeout) in between the packets, then this._udp
will already be null
. The next packet can not be sent and throws an (uncatchable) error ("TypeError: Cannot read property 'send' of null" at line 214) instead.
let send = () => {...}
is simply missing a check if this._udp
ist still set properly.
I think it can easily be reproduced by setting _DISCOVERY_WAIT
smaller than _DISCOVERY_RETRY_MAX * _DISCOVERY_INTERVAL * 3
.