mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 17:08:54 +00:00
Added socket_set_timeout (PLEASE SCRUTINIZE).
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@30937 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
7116c8084d
commit
23bd5dec7c
1 changed files with 44 additions and 0 deletions
|
@ -540,6 +540,50 @@ if (!$fp) {
|
|||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<refentry id="function.socket-set-timeout">
|
||||
<refnamediv>
|
||||
<refname>socket_set_timeout</refname>
|
||||
<refpurpose>Set timeout period on a socket</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
<funcdef>bool <function>socket_set_timeout</function></funcdef>
|
||||
<paramdef>int <parameter>socket descriptor</parameter></paramdef>
|
||||
<paramdef>int <parameter>seconds</parameter></paramdef>
|
||||
<paramdef>int <parameter>microseconds</parameter></paramdef>
|
||||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
<para>
|
||||
Sets the timeout value on <parameter>socket descriptor</parameter>,
|
||||
expressed in the sum of <parameter>seconds</parameter> and
|
||||
<parameter>microseconds</parameter>.
|
||||
<title><function>socket_set_timeout</function> Example</title>
|
||||
<programlisting role="php">
|
||||
<?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";
|
||||
}
|
||||
?>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
<para>
|
||||
This function was previously called as
|
||||
<function>set_socket_timeout</function> but this usage is deprecated.
|
||||
</para>
|
||||
<para>
|
||||
See also: <function>fsockopen</function>and<function>fopen</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<refentry id="function.syslog">
|
||||
<refnamediv>
|
||||
|
|
Loading…
Reference in a new issue