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.

resource socket_create_listen ( int $port [, int $backlog ] ) - 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.

bool socket_getpeername ( resource $socket , string &$address [, int &$port ] ) - Queries the remote side of the given socket which may either result in host/port or in a Unix filesystem path, dependent on its type.

int socket_last_error ([ resource $socket ] ) - If a socket resource is passed to this function, the last error which occurred on this particular socket is returned. If the socket resource is omitted, the error code of the last failed socket function is returned.

int socket_recvfrom ( resource $socket , string &$buf , int $len , int $flags , string &$name [, int &$port ] ) - The socket_recvfrom() function receives len bytes of data in buf from name on port port (if the socket is not of type AF_UNIX) using socket. socket_recvfrom() can be used to gather data from both connected and unconnected sockets. Additionally, one or more flags can be specified to modify the behaviour of the function.