 |
 |
 |
 |
Warning: include(../levoe_menu.php) [ function.include]: failed to open stream: No such file or directory in /var/www/prime/data/www/prime-speed.ru/Manual_PHP_4/f/socket-set-timeout.html on line 46
Warning: include() [ function.include]: Failed opening '../levoe_menu.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/prime/data/www/prime-speed.ru/Manual_PHP_4/f/socket-set-timeout.html on line 46
|
 |
 |
 |
 | |
|  |
(PHP 4)
socket_set_timeout - установить период таймаута для сокета. Описаниеbool socket_set_timeout (int socket descriptor, int seconds, int microseconds)
Устанавливает значение таймаута на socket descriptor, выраженное суммой seconds и
microseconds. Пример 1. socket_set_timeout()
<?php
$fp = fsockopen("www.example.com", 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;
}
?> |
|
Эта функция вызывалась раньше set_socket_timeout(), но это теперь не рекомендуется.
См. также fsockopen() и fopen(). |  | |
|
 |
 |
 |
 |
Warning: include(../pravoe_menu.php) [ function.include]: failed to open stream: No such file or directory in /var/www/prime/data/www/prime-speed.ru/Manual_PHP_4/f/socket-set-timeout.html on line 152
Warning: include() [ function.include]: Failed opening '../pravoe_menu.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/prime/data/www/prime-speed.ru/Manual_PHP_4/f/socket-set-timeout.html on line 152
|
 |
 |
 |
 | |