Warning |
This function is EXPERIMENTAL. That means, that the behaviour of this function, this function name, in concreto ANYTHING documented here can change in a future release of PHP WITHOUT NOTICE. Be warned, and use this function at your own risk. |
After the socket socket has been created using socket(), bound to a name with bind(), and told to listen for connections with listen(), this function will accept incoming connections on that socket. Once a successful connection is made, a new socket descriptor 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, accept_connect() will block until a connection becomes present. If socket has been made non-blocking using socket_set_blocking() or set_nonblock(), an error code will be returned.
The socket descriptor returned by accept_connect() may not be used to accept new connections. The original listening socket socket, however, remains open and may be reused.
Returns a new socket descriptor on success, or a negative error code on failure. This code may be passed to strerror() to get a textual explanation of the error.
See also bind(), connect(), listen(), socket(), socket_get_status(), and strerror().