Gold Vision Communications / USA
 GOLDVISION.COM
Serving the Multimedia Community since 1989.
English Site | German Site 

 Web Hosting

 Virtual Dedicated Servers

 Chequeo de dominio

 Haga su pedido

 Estado del pedido

 Support

 Contáctenos

 Download

 Network

 Network Status

 Webdesign / Templates

 Efectuar pago

 Terms & Conditions

 Imprimir

 Notas Legales

 Declaración de Privacidad
  PHP / socket_set_timeout
socket_set_timeout

socket_set_timeout

(PHP 4 )

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.

Ejemplo 1. socket_set_timeout() Example

<?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;
}
?>

This function was previously called as set_socket_timeout() but this usage is deprecated.

See also: fsockopen() and fopen().


© 1998-2009 Gold Vision Communications All Rights Reserved.