PHP
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

syslog> <socket_set_blocking
Last updated: Sat, 24 Mar 2007

view this page in

socket_set_timeout

(PHP 4, PHP 5)

socket_set_timeout — Nastaví časový limit (timeout) socketu

Popis

bool socket_set_timeout ( int $socket descriptor, int $seconds, int $microseconds )

Nastavuje velikost časového limitu socketu daného hodnotou socket descriptor, ve formě součtu sekund (seconds) a mikrosekund (microseconds).

Příklad 1339. socket_set_timeout() Příklad

<?php
$fp
= fsockopen("www.example.com", 80);
if(!
$fp) {
    echo
"Nelze otevřít\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;
}
?>

Tato funkce se dříve jmenovala set_socket_timeout(), ale tento název je nyní zavržený.

Viz také: fsockopen() a fopen().



add a note add a note User Contributed Notes
socket_set_timeout
There are no user contributed notes for this page.

syslog> <socket_set_blocking
Last updated: Sat, 24 Mar 2007
 
 
show source | credits | stats | sitemap | contact | advertising | mirror sites