Method Stdio.UDP()->bind()
- Method bind
UDP bind(int|string port, string|void address, string|bool no_reuseaddr)
- Description
Binds a port for receiving or transmitting UDP.
- Parameter port
Either a port number or the name of a service as listed in /etc/services.
- Parameter address
Local address to bind to.
- Parameter no_reuseaddr
If set to
1, Pike will not set theSO_REUSEADDRoption on the UDP port.- Note
SO_REUSEADDRis never applied when binding a random port (bind(0)).In general,
SO_REUSEADDRis not desirable on UDP ports. Unless used for receiving multicast, be sure to never bind a non-random port without settingno_reuseaddrto1.- Throws
Throws error when unable to bind port.