Skip to main content
Socket.prototype.setBroadcast - node__dgram.d.ts - Node documentation
method Socket.prototype.setBroadcast

Usage in Deno

```typescript import { Socket } from "node:node__dgram.d.ts"; ```
Socket.prototype.setBroadcast(flag: boolean): void
Sets or clears the `SO_BROADCAST` socket option. When set to `true`, UDP packets may be sent to a local interface's broadcast address. This method throws `EBADF` if called on an unbound socket.

Parameters

flag: boolean

Return Type

void