accept_connect

(4.0.2 - 4.0.6 only)

accept_connect -- Accepts a connection on a socket

Description

int accept_connect (resource socket)

Atenção

Esta função é EXPERIMENTAL. Isso quer dizer que o comportamento desta função e seu nome, incluindo TUDO o que está documentado aqui pode mudar em futuras versões do PHP, SEM QUALQUER NOTIFICAÇÃO. Esteja avisado, e use esta função por sua própria conta e risco.

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().