Socket context options

Socket context options — Socket context option listing

Description

Socket context options are available for all wrappers that work over
sockets, like tcp, http and
ftp.

Options

bindto

Used to specify the IP address (either IPv4 or IPv6) and/or the
port number that PHP will use to access the network. The syntax
is ip:port for IPv4 addresses, and
[ip]:port for IPv6 addresses.
Setting the IP or the port to 0 will let the system
choose the IP and/or port.

Note:

As FTP creates two socket connections during normal operation,
the port number cannot be specified using this option.

backlog

Used to limit the number of outstanding connections in the
socket's listen queue.