Skip to content

Commit

Permalink
fix: Resolving broadcast option within UDP Helper (#101)
Browse files Browse the repository at this point in the history
  • Loading branch information
Luuccc authored Nov 7, 2024
1 parent d4e9c96 commit 3ea9614
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/helpers/udp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,6 @@ export class UDPHelper extends EventEmitter<UDPHelperEvents> {
)
}

if (this.#options.broadcast) {
this.#socket.setBroadcast(true)
}

if (this.#options.ttl !== undefined) {
this.#socket.setTTL(this.#options.ttl)
}
Expand All @@ -110,6 +106,11 @@ export class UDPHelper extends EventEmitter<UDPHelperEvents> {
// }
// }

// Needed to be called after bind() had completed
if (this.#options.broadcast) {
this.#socket.setBroadcast(true)
}

if (this.#options.multicast_interface) {
this.#socket.setMulticastInterface(this.#options.multicast_interface)
}
Expand Down

0 comments on commit 3ea9614

Please sign in to comment.