PHP.nl

socket_accept

socket_accept

Accepts a connection on a socket

 **socket_accept** Socket $socket

After the socket has been created using , bound to a name with , and told to listen for connections with , this function will accept incoming connections on that socket. Once a successful connection is made, a new instance is returned, which may be used for communication. If there are multiple connections queued on the socket, the first will be used. If there are no pending connections, will block until a connection becomes present. If has been made non-blocking using or , false will be returned. socket``socket_create``socket_bind``socket_listen``Socket``socket_accept``socket``socket_set_blocking``socket_set_nonblock

The instance returned by may not be used to accept new connections. The original listening socket , however, remains open and may be reused. Socket``socket_accept``socket

socket A instance created with . Socket``socket_create

Returns a new instance on success, or false on error. The actual error code can be retrieved by calling . This error code may be passed to to get a textual explanation of the error. Socket``socket_last_error``socket_strerror

socket_connect``socket_listen``socket_create``socket_bind``socket_strerror