#35062 [Opn->Bgs]: socket_read() produces warnings on non blocking sockets

From: Date: Wed, 02 Nov 2005 13:18:25 +0000
Subject: #35062 [Opn->Bgs]: socket_read() produces warnings on non blocking sockets
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-87403@lists.php.net to get a copy of this message
 ID:               35062
 Updated by:       sniper@php.net
 Reported By:      dima at dimych dot sumy dot ua
-Status:           Open
+Status:           Bogus
 Bug Type:         Sockets related
 Operating System: FreeBSD 4.9-STABLE #0
 PHP Version:      4.4.1RC1
 New Comment:

Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system
is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.




Previous Comments:
------------------------------------------------------------------------

[2005-11-02 08:52:06] dima at dimych dot sumy dot ua

Description:
------------
Use of socket_read() on non blocking sockets produces warinigs like:
socket_read() unable to read from socket [35]: Resource temporarily
unavailable

I`m storing all php errors in log file /var/log/php.log.
This warning causes overflow of /var partition because socket_read()
called to wait icmp message. 


Reproduce code:
---------------
$socket = socket_create(AF_INET, SOCK_RAW, 1);
socket_connect($socket, $host, null);
$startTime = microtime_float(true);
socket_send($socket, $data, strLen($data), 0);
socket_set_nonblock($socket);
while((microtime_float() - $startTime) < 0.5) {
  $mt = microtime_float();
  if (socket_read($socket, 255)) {
     break;
  }
}
socket_close($socket);


Expected result:
----------------
no warnings in php.log

Actual result:
--------------
I`m receive huge count of warinigs in my php.log file like this:
socket_read() unable to read from socket [35]: Resource temporarily
unavailable



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=35062&edit=1


Thread (11 messages)

« previous php.bugs (#87403) next »