ID: 21760 Comment by: jason at superlink dot net Reported By: sunday at csh dot rit dot edu Status: No Feedback Bug Type: Sockets related Operating System: FreeBSD 4.7 PHP Version: 4.3.0 New Comment:
Bug is on 4.3.2 on redhat too. Previous Comments: ------------------------------------------------------------------------ [2003-06-17 11:53:13] zstealer at nospam dot msn dot com Im having a similar problem, Im working on an IRC bot, Im using the latest stable version for windows, (4.3.3 i think) and Windows XP professional with all the latest updates. Obviously, when i do socket_read with PHP_NORMAL_READ, it returns nothing, but PHP_BINARY_READ works fine. Please fix this, I have been looking for help for a long time, Many people told me PHP_NORMAL_READ is currently buggy at the moment. ------------------------------------------------------------------------ [2003-06-06 21:55:27] jason at superlink dot net I have this problem on PHP 4.3.2 with FreeBSD 4.8. socket_read() will return an infinate amount of "\n" from the socket. This ends up using a LOT of cpu as you can well imagine. I had to write a script to kill all php processes when over 40% cpu usage. (This was before I knew about the infinate \n output). ------------------------------------------------------------------------ [2003-05-27 05:59:46] phpbugs at miloware dot org I'm having similar problems (PHP 4.3.1 / Windows 2003 Server Ent). Seems that adding PHP_NORMAL_READ will cause socket_read() to fail: Warning: socket_read() unable to read from socket [0] While ommiting the parameter will cause socket_read() to either not reading all the data available, or cause a never ending loop. Hope this helps ------------------------------------------------------------------------ [2003-05-15 08:37:44] wills at housing dot ufl dot edu I am having a similar problem with the latest -STABLE snapshot from 8:30GMT today. When I use socket_read with PHP_NORMAL_READ, I get no data returned and 'Operation completed successfully' as the returned error. This is on a Win2k SP3 system, IIS 5.0, again with the latest -STABLE snapshot. This also occurs with 4.3.2-RC2. I would be happy to test patches but I do not have the means to compile a new PHP so I am depending on the SNAPSHOTs. ------------------------------------------------------------------------ [2003-03-19 16:00:22] hans at nyu dot edu I'd like to supply some feedback to this bug. I'm operating in nearly an identical environment: FreeBSD 4.7-STABLE, PHP 4.3.1 CLI. It seems that specifying PHP_NORMAL_READ works, however it'll give an erroneous error: $buf = socket_read($csock,4096,PHP_NORMAL_READ); will yield: socket_read() unable to read from socket [54]: Connection reset by peer but: $buf = socket_read($csock,4096); will give no error. Now both the above situations are when less than 4096 bytes of data are written on the other end of the socket. If I specify a length of 5 and write 5, I don't believe I see the error, however, placing the PHP_NORMAL_READ call in a loop will iterate an extra time and cause the error again. I know my report is bit a scant, but I can supply any additional data if needed. Regards ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/21760 -- Edit this bug report at http://bugs.php.net/?id=21760&edit=1