From 23bd5dec7cab264f3ea758e2d0c7c5d470fc590a Mon Sep 17 00:00:00 2001 From: Ron Chmara Date: Wed, 23 Aug 2000 07:24:56 +0000 Subject: [PATCH] Added socket_set_timeout (PLEASE SCRUTINIZE). git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@30937 c90b9560-bf6c-de11-be94-00142212c4b1 --- functions/network.xml | 44 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/functions/network.xml b/functions/network.xml index c017fe2153..5ac5b3de1f 100644 --- a/functions/network.xml +++ b/functions/network.xml @@ -540,6 +540,50 @@ if (!$fp) { + + + + 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. + <function>socket_set_timeout</function> Example + +<?php +socket_set_timeout(80,5,0) +// set 5 second maximum for connection over port 80 +$fp = fopen("http://www.php.net/index.php","r"); +if (!$fp) { + print"Unable to open"; +} else { + print"Opened in less than 5 sec"; +} +?> + + + + + This function was previously called as + set_socket_timeout but this usage is deprecated. + + + See also: fsockopenandfopen. + + +