Method _Stdio.UDP()->bind()
- Method
bind
UDPbind(int|stringport,string|voidaddress,string|boolno_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.