#21197 [Asn]: [PATCH] socket_read() outputs error with PHP_NORMAL_READ
From: jani@php.net Date: Tue, 17 Jul 2007 20:57:54 +0000 Subject: #21197 [Asn]: [PATCH] socket_read() outputs error with PHP_NORMAL_READ References: 1 Groups: php.bugs Request: Send a blank email to php-bugs+get-115153@lists.php.net to get a copy of this message
ID: 21197
Updated by: jani@php.net
Reported By: bool at boolsite dot net
Status: Assigned
Bug Type: Sockets related
Operating System: *
PHP Version: 5.*, 4.* (2005-11-17) (cvs)
-Assigned To: pollita
+Assigned To: jani
New Comment:
I have a patch prepared for this. Just waiting for dinesh at dinsoft
dot net to test it for me. :)
Previous Comments:
------------------------------------------------------------------------
[2007-06-23 22:23:06] dinesh at dinsoft dot net
Indeed, it works with :
//m = fcntl(bsd_socket, F_GETFL);
//if (m < 0) {
// return m;
//}
nonblock = 0;
So the fcntl() call makes it fail.
But this has the side effect of making the socket_read() call blocking
even if the socket has been set to non blocking mode.
I will try to make a fully working patch with no side effect when I'll
have some time, if no one else is wanting to solve this problem.
For the lambda users, here is a usuable dll built against PHP 5.2.3 :
http://www.dinsoft.net/dev/php/php_sockets.dll
Regards,
Dinesh Bolkensteyn
------------------------------------------------------------------------
[2007-06-23 13:33:06] dinesh at dinsoft dot net
Hi all,
The bug is still there in: PHP 5.2.3 (cli) (built: May 31 2007
09:37:22) (binary zip release)
The initial bug report was posted on 26 Dec 2002 9:32am UTC, almost 5
years ago.
PHP_NORMAL_READ works well under *NIX, but the same scripts does not
work on windows.
If the above patch is working, then it should be added in the binary
release.
Thanks.
------------------------------------------------------------------------
[2006-11-15 06:33:38] thessoro at gmail dot com
I think the existence of this bug should be mentioned in the
documentation to prevent developers rely on PHP_NORMAL_READ. Although OS
category is set to * i can only reproduce it in windows. I checked my
script there too late.
So, as a script relying this feature is capable of making the entire
socket extension useless on Windows, i think is important enough to
mention it en the socket_read section of the manual.
Thx,
------------------------------------------------------------------------
[2005-11-05 22:10:22] nlopess@php.net
I've made a patch that implements the idea of my last comment. The test
case now works properly.
I haven't tested bug #35062 but it seems to be a different bug.
http://mega.ist.utl.pt/~ncpl/php_sockets_win.txt
------------------------------------------------------------------------
[2005-11-05 01:36:39] nlopess@php.net
I was walking through the MSDN docs and I didn't also find anything.
But the best way (IMHO) is to store in the php_socket struct if the
socket is blocking or not (and update that field in the
socket_set_(non)block() functions). It also saves the fcntl syscall on
nix systems.
------------------------------------------------------------------------
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/21197
--
Edit this bug report at http://bugs.php.net/?id=21197&edit=1
Thread (46 messages)
- #21197 [Opn->Ver]: socket_read() seems to doesn't work
- #21197 [Com]: socket_read() seems to doesn't work
- #21197 [Ver->Ana]: socket_read() seems to doesn't work
- #21197 [Com]: socket_read() seems to doesn't work
- #21197 [Ana->Bgs]: socket_read() seems to doesn't work
- #21197 [Bgs]: socket_read() seems to doesn't work
- #21197 [Bgs->Opn]: socket_read() seems to doesn't work
- #21197 [Opn->Fbk]: socket_read() seems to doesn't work
- #21197 [Fbk->Opn]: socket_read() seems to doesn't work
- #21197 [Com]: socket_read() seems to doesn't work
- #21197 [Opn->Ver]: socket_read() seems to doesn't work
- #21197 [Com]: socket_read() outputs error with PHP_NORMAL_READ
- #21197 [Ver->Fbk]: socket_read() outputs error with PHP_NORMAL_READ
- #21197 [Fbk->NoF]: socket_read() outputs error with PHP_NORMAL_READ
- #21197 [Com]: socket_read() outputs error with PHP_NORMAL_READ
- #21197 [NoF->Opn]: socket_read() outputs error with PHP_NORMAL_READ
- #21197 [Opn->Asn]: socket_read() outputs error with PHP_NORMAL_READ
- #21197 [Asn->Fbk]: socket_read() outputs error with PHP_NORMAL_READ
- #21197 [Fbk->Opn]: socket_read() outputs error with PHP_NORMAL_READ
- #21197 [Opn]: socket_read() outputs error with PHP_NORMAL_READ
- #21197 [Opn]: socket_read() outputs error with PHP_NORMAL_READ
- #21197 [Opn->Asn]: socket_read() outputs error with PHP_NORMAL_READ
- #21197 [Asn->Opn]: socket_read() outputs error with PHP_NORMAL_READ
- #21197 [Com]: socket_read() outputs error with PHP_NORMAL_READ
- #21197 [Com]: socket_read() outputs error with PHP_NORMAL_READ
- #21197 [Com]: socket_read() outputs error with PHP_NORMAL_READ
- #21197 [Com]: socket_read() outputs error with PHP_NORMAL_READ
- #21197 [Com]: socket_read() outputs error with PHP_NORMAL_READ
- #21197 [Opn->Fbk]: socket_read() outputs error with PHP_NORMAL_READ
- #21197 [Com]: socket_read() outputs error with PHP_NORMAL_READ
- #21197 [NoF->Opn]: socket_read() outputs error with PHP_NORMAL_READ
- #21197 [Opn]: socket_read() outputs error with PHP_NORMAL_READ
- #21197 [Opn]: socket_read() outputs error with PHP_NORMAL_READ
- #21197 [Opn]: socket_read() outputs error with PHP_NORMAL_READ
- #21197 [Opn]: socket_read() outputs error with PHP_NORMAL_READ
- #21197 [Opn]: socket_read() outputs error with PHP_NORMAL_READ
- #21197 [Opn->Fbk]: [PATCH] socket_read() outputs error with PHP_NORMAL_READ
- #21197 [Fbk->Ver]: [PATCH] socket_read() outputs error with PHP_NORMAL_READ
- #21197 [Ver->Asn]: [PATCH] socket_read() outputs error with PHP_NORMAL_READ
- #21197 [Com]: [PATCH] socket_read() outputs error with PHP_NORMAL_READ
- #21197 [Com]: [PATCH] socket_read() outputs error with PHP_NORMAL_READ
- #21197 [Com]: [PATCH] socket_read() outputs error with PHP_NORMAL_READ
- #21197 [Asn]: [PATCH] socket_read() outputs error with PHP_NORMAL_READ
- #21197 [Asn]: [PATCH] socket_read() outputs error with PHP_NORMAL_READ
- #21197 [Asn->Csd]: [PATCH] socket_read() outputs error with PHP_NORMAL_READ
| « previous | php.bugs (#115153) | next » |
|---|