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
)
);
<br><font color="#e78608">------解决方案--------------------</font><br>
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn