Skip to main content

Interface: UDPSocketOptions

Properties​

broadcast?​

optional broadcast?: boolean

Enable sending to broadcast addresses (SO_BROADCAST). Default is false.


dnsQueryType?​

optional dnsQueryType?: "ipv4" | "ipv6"

Force the address family used to resolve addresses.


ipv6Only?​

optional ipv6Only?: boolean

Restrict an AF_INET6 socket to IPv6 only.


localAddress?​

optional localAddress?: string

Local address to bind to.


localPort?​

optional localPort?: number

Local port to bind to. Defaults to an OS-assigned port (0).


multicastAllowAddressSharing?​

optional multicastAllowAddressSharing?: boolean

Permits address reuse, essential for multiple applications listening on the same multicast address/port. Default is false.


multicastLoopback?​

optional multicastLoopback?: boolean

Whether packets sent to the multicast group are looped back to the sender. Default is true.


multicastTimeToLive?​

optional multicastTimeToLive?: number

TTL for multicast packets. Each router hop decrements this value. Default is 1.


remoteAddress?​

optional remoteAddress?: string

Default remote address for sent datagrams (connects the socket).


remotePort?​

optional remotePort?: number

Default remote port for sent datagrams.


reuseAddr?​

optional reuseAddr?: boolean

Allow reuse of a local address already in use (SO_REUSEADDR).