ID:               36314
 Updated by:       [EMAIL PROTECTED]
 Reported By:      flachi at gmail dot com
-Status:           Open
+Status:           Bogus
 Bug Type:         Sockets related
 Operating System: Windows
 PHP Version:      4.4.2
 New Comment:

Duplicate of bug #21197.


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

[2006-02-07 04:59:01] flachi at gmail dot com

Description:
------------
I tested this also on Linux and it works ok. When I use socket_read
with PHP_NORMAL_READ as third parameter it gaves me a warning and
doesn't take into account the if the socket is blocking. I looked in
the sources but I found nothing that would let me know why is this
happening (maybe in php_read ?). I've seen that there are a lot of bugs
with this function on Win32. A very good ideea would be to rewrite it
from scratch.

Reproduce code:
---------------
  $g = socket_create (AF_INET, SOCK_STREAM, SOL_TCP);
  socket_connect ($g, "helsinki.fi.eu.undernet.org", 6667);
  socket_set_block ($g);
  $s = "USER flachi flachi flachi :flachi\r\nNICK floadssaas\r\n";
  socket_write ($g, $s, strlen ($s));
  while (($s = socket_read ($g, 512, PHP_NORMAL_READ)) !== false) {
echo $s; }
  socket_shutdown ($g, 2); socket_close ($g);

Expected result:
----------------
This should connect to that IRC server and get some lines of code. Here
is how it should work (and does on Linux):

~$ php -q test3.php
NOTICE AUTH :*** Looking up your hostname
NOTICE AUTH :*** Checking Ident
NOTICE AUTH :*** Couldn't look up your hostname
PING :34913160

Actual result:
--------------
This is what I get on Windows. It doesn't receive anything from the IRC
server.

G:\Foo\fbot>php -d output_buffering=8 -d html_errors=off -q test.php
PHP Warning:  socket_read() unable to read from socket [0]: The
operation completed successfully.
 in G:\Foo\fbot\test.php on line 8


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


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

Reply via email to