#21197 [Com]: socket_read() seems to doesn't work

From: Date: Thu, 06 Feb 2003 03:13:08 +0000
Subject: #21197 [Com]: socket_read() seems to doesn't work
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-32262@lists.php.net to get a copy of this message
 ID:               21197
 Comment by:       chip@cyan.com
 Reported By:      bool@boolsite.net
 Status:           Analyzed
 Bug Type:         Sockets related
 Operating System: Win2k pro
 PHP Version:      4.3.0RC4
 New Comment:

See my comment on this bug report:
http://bugs.php.net/bug.php?id=21760

I tested the same script on windows 2000, and it broke.


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

[2003-01-09 13:13:25] nicos@php.net

I've analyzed this bug. It's because of fcntl() that just returns -1
under windows when F_GETFL is given. Then the php_read function just
also returns -1 and then socket_read sends the error because it
returned -1. 

I've sent my comment to Wez too.

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

[2002-12-30 23:08:50] eric@evilwalrus.com

I've experianced this bug on WindowsXP also. I've tried PHP 4.3.0
(stable) and 4.4.0-dev just to see if it was fixed, and it is not. I
have also talked to someone with WindowsXP who experianced this problem
in PHP 4.2.3. The function does work fine without a third parameter,
but, this is a big inconvienice when I need the read to stop at \n or
\r. The function just stops reading when the buffer is full if there is
no third parameter. Hope this is helpful.

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

[2002-12-26 20:39:22] edink@php.net

If you omit the third parameter to socket_read() it seems to work fine.
However, adding PHP_NORMAL_READ causes error as described in the bug
report.

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

[2002-12-26 09:32:25] bool@boolsite.net

Hello

I have a source which works with PHP 4.1.x to PHP 4.2.x,
it's work perfectly. But with PHP 4.3RC4 (windows version,
client mode) I have this warning :
Warning: socket_read() unable to read from socket [0]: OpÚration
rÚussie. in E:\PHP\KioobFTP\v0.7.1\KioobFTP_SocketMode.php on line 262

Then, the result of the function is FALSE. 
The socket is in blocking mode.
The code is :
$tmp=socket_read($this->stream,4096,PHP_NORMAL_READ);

Do you need others info ?

Thanks.

Bool

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


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



Thread (46 messages)

« previous php.bugs (#32262) next »