ID:               16680
 Updated by:       [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
 Status:           Open
 Bug Type:         Sockets related
 Operating System: Windows 9x
 PHP Version:      4.2.0
 New Comment:

i have exactly the same problem with win2000.
it closes the connection immidiatly after the first received char.

that little scriptlet upthere seems to be be a way around this.

is this a bug or is it suppost to work like this?


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

[2002-04-18 09:57:00] [EMAIL PROTECTED]

In the documentation, it's written that socket_read() reads data from
the socket until a \n, \t, \0.... or until the end of the buffer.
But under win32 it reads only 1 char.

This would be fixed.

Just use instead :
$buf="";
while (substr($buf,-1)!="\n") {
  $buf.=socket_read($socket,1);
}

I've put 1 here, but you can write 16777216 it'll continue to give back
only 1 char.

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


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

Reply via email to