note 54705 added to function.socket-set-option
| From: | luzhongda at ysh dot com dot cn | Date: | Wed, 13 Jul 2005 08:34:46 +0000 |
| Subject: | note 54705 added to function.socket-set-option | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-91874@lists.php.net to get a copy of this message | ||
When the options in the following code are set, the error messge
is displayed:
E_WARNING: socket_read() unable to read from socket [4]: Interrupted system call in /root/socket.php
on line 390
The source code is:
function connect()
{
$result = false;
/* Create a TCP/IP socket. */
$this->socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
if ($this->socket==false) {
$this->_logger->debug( "socket_create() failed\n");
} else {
$this->_logger->debug( "The socket is created.\n");
}
$result = socket_connect($this->socket, $this->ipAddress, $this->port);
if ($result == false) {
$this->_logger->debug( "socket_connect() failed \n");
$result = false;
$this->socket = null;
}
else {
socket_set_option($this->socket,SOL_SOCKET, SO_KEEPALIVE, 1);
socket_set_option($this->socket,SOL_SOCKET, SO_RCVTIMEO, array("sec"=>3,
"usec"=>0));
socket_set_option($this->socket,SOL_SOCKET, SO_SNDTIMEO, array("sec"=>3,
"usec"=>0));
socket_set_option($this->socket, SOL_SOCKET, SO_REUSEADDR, 1);
$result = true;
}
return $result;
}
----
Manual Page -- http://www.php.net/manual/en/function.socket-set-option.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+54705
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+54705&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+54705&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+54705&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+54705&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+54705&report=yes&reason=non-english
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+54705&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+54705&report=yes
Search -- http://master.php.net/manage/user-notes.php