Add support for udp bind port override (3.0.5) Fixes #149

This commit is contained in:
Michael Morrison 2021-05-18 23:13:18 -05:00
parent 68b8dfd684
commit ce4e728493
8 changed files with 59 additions and 26 deletions

View file

@ -252,13 +252,9 @@ class Core extends EventEmitter {
this.assertValidPort(port);
if(typeof buffer === 'string') buffer = Buffer.from(buffer,'binary');
this.debugLog(log => {
log(address+':'+port+" UDP-->");
log(HexUtil.debugDump(buffer));
});
const socket = this.udpSocket;
socket.send(buffer, address, port);
await socket.send(buffer, address, port, this.options.debug);
if (!onPacket && !onTimeout) {
return null;