socket_get_option

(PHP 4 >= 4.3.0, PHP 5, PHP 7) Gets socket options for the socket mixed socket_get_option ( resource $socket, int $level, int $optname ) The socket_get_option() function retrieves the value for the option specified by the optname parameter for the specified socket. Parameters: socket A valid socket resource created with socket_create() or socket_accept().

socket_create

(PHP 4 >= 4.1.0, PHP 5, PHP 7) Create a socket (endpoint for communication) resource socket_create ( int $domain, int $type, int $protocol ) Creates and returns a socket resource, also referred to as an endpoint of communication. A typical network connection is made up of 2 sockets, one performing the role of the client, and another performing the role of the server. Parameters: do

socket_create_pair

(PHP 4 >= 4.1.0, PHP 5, PHP 7) Creates a pair of indistinguishable sockets and stores them in an array bool socket_create_pair ( int $domain, int $type, int $protocol, array &$fd ) socket_create_pair() creates two connected and indistinguishable sockets, and stores them in fd. This function is commonly used in IPC (InterProcess Communication). Parameters: domain Th

socket_create_listen

(PHP 4 >= 4.1.0, PHP 5, PHP 7) Opens a socket on port to accept connections resource socket_create_listen ( int $port [, int $backlog = 128 ] ) socket_create_listen() creates a new socket resource of type AF_INET listening on all local interfaces on the given port waiting for new connections. This function is meant to ease the task of creating a new socket which only listens to accept new connections.

socket_connect

(PHP 4 >= 4.1.0, PHP 5, PHP 7) Initiates a connection on a socket bool socket_connect ( resource $socket, string $address [, int $port = 0 ] ) Initiate a connection to address using the socket resource socket, which must be a valid socket resource created with socket_create(). Parameters: socket Initiate a connection to address using the socket resource socket, which

socket_cmsg_space

(PHP 5 >= 5.5.0, PHP 7) Calculate message buffer size int socket_cmsg_space ( int $level, int $type ) Calculates the size of the buffer that should be allocated for receiving the ancillary data. Parameters: level Calculates the size of the buffer that should be allocated for receiving the ancillary data. type Calculates the size of t

socket_close

(PHP 4 >= 4.1.0, PHP 5, PHP 7) Closes a socket resource void socket_close ( resource $socket ) socket_close() closes the socket resource given by socket. This function is specific to sockets and cannot be used on any other type of resources. Parameters: socket A valid socket resource created with socket_create() or socket_accept(). Returns: N

socket_clear_error

(PHP 4 >= 4.2.0, PHP 5, PHP 7) Clears the error on the socket or the last error code void socket_clear_error ([ resource $socket ] ) This function clears the error code on the given socket or the global last socket error if no socket is specified. This function allows explicitly resetting the error code value either of a socket or of the extension global last error code. This may be useful to detect within a part of th

socket_bind

(PHP 4 >= 4.1.0, PHP 5, PHP 7) Binds a name to a socket bool socket_bind ( resource $socket, string $address [, int $port = 0 ] ) Binds the name given in address to the socket described by socket. This has to be done before a connection is be established using socket_connect() or socket_listen(). Parameters: socket A valid socket resource created with socket_create().

socket_accept

(PHP 4 >= 4.1.0, PHP 5, PHP 7) Accepts a connection on a socket resource socket_accept ( resource $socket ) After the socket socket has been created using socket_create(), bound to a name with socket_bind(), and told to listen for connections with socket_listen(), this function will accept incoming connections on that socket. Once a successful connection is made, a new socket resource is returned, which may be used for co