PHP.nl

socket_listen

socket_listen

Listens for a connection on a socket

bool **socket_listen** Socket $socket int $backlog

After the socket has been created using and bound to a name with , it may be told to listen for incoming connections on . socket``socket_create``socket_bind``socket

is applicable only to sockets of

type or . socket_listen``SOCK_STREAM``SOCK_SEQPACKET

socket A instance created with or Socket``socket_create``socket_addrinfo_bind

backlog A maximum of incoming connections will be queued for processing. If a connection request arrives with the queue full the client may receive an error with an indication of , or, if the underlying protocol supports retransmission, the request may be ignored so that retries may succeed. backlog``ECONNREFUSED

Opmerking: > The maximum number passed to the parameter highly depends on the underlying platform. On Linux, it is silently truncated to . On win32, if passed , the underlying service provider responsible for the socket will set the backlog to a maximum value. There is no standard provision to find out the actual backlog value on this platform. backlog``SOMAXCONN``SOMAXCONNreasonable

return.success The error code can be retrieved with . This code may be passed to to get a textual explanation of the error. socket_last_error``socket_strerror

socket_accept``socket_bind``socket_connect``socket_create``socket_strerror``socket_addrinfo_bind