this function, compared to the function socket_accept, got an extra argument "timeout".
To make this function wait indefinitelly to incoming connections, just as in socket_accept, set timeout to -1. It works for me with PHP 5.0.4.
stream_socket_acceptDescriptionresource stream_socket_accept ( resource server_socket [, float timeout [, string &peername]] )Accept a connection on a socket previously created by stream_socket_server(). If timeout is specified, the default socket accept timeout will be overridden with the time specified in seconds. The name (address) of the client which connected will be passed back in peername if included and available from the selected transport. peername can also be determined later using stream_socket_get_name(). If the call fails, it will return FALSE.
See also stream_socket_server(), stream_socket_get_name(), stream_set_blocking(), stream_set_timeout(), fgets(), fgetss(), fwrite(), fclose(), feof(), and the Curl extension.
add a note
User Contributed Notes
mickael dot bailly at free dot fr
18-Jul-2006 06:10
this function, compared to the function socket_accept, got an extra argument "timeout".
leleu256NOSPAM at hotmail dot com
02-Nov-2004 09:58
This code could be very helpfull... | ||||