SO_SNDTIMEO Reports the timeout value specifying the amount of time that an output function blocks because flow control prevents data from being sent.array. The array will contain two keys: sec which is the seconds part on the timeout value and usec which is the microsecond part of the timeout value. To set a socket timeout value (assuming you've set it blocking) use:
PHP code
socket_set_option( $socket, SOL_SOCKET, // socket level SO_SNDTIMEO, // timeout option array( "sec"=>10, // Timeout in seconds "usec"=>0 // I assume timeout in microseconds ) ); [解决办法]