Skip to content

Commit

Permalink
check udp bind options
Browse files Browse the repository at this point in the history
  • Loading branch information
icebob committed Dec 3, 2023
1 parent f04c054 commit 48bb931
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/transporters/tcp/udp-broadcaster.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,10 @@ class UdpServer extends EventEmitter {
port = port || 4445;

/** @type {import("dgram").BindOptions} */
const bindOptions = { port, address: host, exclusive: true };
const bindOptions = { port, exclusive: true };
if (host) {
bindOptions.address = host;
}

server.bind(bindOptions, () => {
try {
Expand Down

0 comments on commit 48bb931

Please sign in to comment.