★ wanayoo — archive 1999 http://fr.php.net/manual/cs/function.socket-set-timeout.phpNouvelle recherche | Portail wanayoo
PHP Thursday, March 08, 2001  
downloads | documentation | support | reporting bugs | links | search:  

lookup:
PHP ManuálPHP Manuál
NetworkNetwork
 checkdnsrrcheckdnsrr
 closelogcloselog
 debugger_offdebugger_off
 debugger_ondebugger_on
 define_syslog_variablesdefine_syslog_variables
 fsockopenfsockopen
 gethostbyaddrgethostbyaddr
 gethostbynamegethostbyname
 gethostbynamelgethostbynamel
 getmxrrgetmxrr
 getprotobynamegetprotobyname
 getprotobynumbergetprotobynumber
 getservbynamegetservbyname
 getservbyportgetservbyport
 ip2longip2long
 long2iplong2ip
 openlogopenlog
 pfsockopenpfsockopen
 socket_get_statussocket_get_status
 socket_set_blockingsocket_set_blocking
 socket_set_timeoutsocket_set_timeout
 syslogsyslog

previoussocket_set_blocking
syslognext

Last updated: Thu, 01 Mar 2001
view this page in English | Brazilian Portuguese | Dutch | French | German | Hungarian | Japanese | Korean | Plain HTML

socket_set_timeout

(PHP 4 >= 4.0b4)

socket_set_timeout -- Set timeout period on a socket

Description

bool 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.

Příklad 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().

previoussocket_set_blocking
syslognext

Last updated: Thu, 01 Mar 2001
add note | about notes


show source | credits | mirror sites:  

Copyright © 1998,1999,2000,2001 The PHP Association, Inc.
All rights reserved.
This mirror generously provided by: L'Université Michel de Montaigne Bordeaux III
Last updated: Thu Mar 08 03:01:32 2001