function socket set timeout C7U6RG4ZYTPQWLBCYGVXQ2LNDARRTRU7Z4Z3ALQ
socket_set_timeoutPodręcznik PHPPoprzedniNastępnysocket_set_timeout (PHP 4 >= 4.0.0)socket_set_timeout -- Set timeout period on a socketDescriptionbool socket_set_timeout (int socket descriptor, int seconds, int microseconds)
Sets the timeout value on socket descriptor,
expressed in the sum of seconds and
microseconds.
Przykład 1. socket_set_timeout() Example<?php
$fp = fsockopen("www.php.net", 80);
if(!$fp) {
echo "Unable to open\n";
} else {
fputs($fp,"GET / HTTP/1.0\n\n");
$start = time();
socket_set_timeout($fp, 2);
$res = fread($fp, 2000);
var_dump(socket_get_status($fp));
fclose($fp);
print $res;
}
?>
This function was previously called as
set_socket_timeout() but this usage is deprecated.
See also: fsockopen() and fopen().
PoprzedniSpis treściNastępnysocket_set_blockingPoczątek rozdziałusyslog
Wyszukiwarka