#32979 [Asn]: socket stream opened with stream_socket_client doesnt work with stream_select
From: mjpph at stardust dot fi Date: Fri, 27 May 2005 12:10:52 +0000 Subject: #32979 [Asn]: socket stream opened with stream_socket_client doesnt work with stream_select References: 1 Groups: php.bugs Request: Send a blank email to php-bugs+get-79608@lists.php.net to get a copy of this message
ID: 32979
User updated by: mjpph at stardust dot fi
Reported By: mjpph at stardust dot fi
Status: Assigned
Bug Type: Network related
Operating System: Linux (Fedora Core 3)
PHP Version: 5CVS-2005-05-08 (dev)
Assigned To: wez
New Comment:
Only change has been the service port and sometimes the IP if the
actual server doesn't host it's own SMTP. I've tested the SMTP
availability with telnet and by using fgets instead of stream_select.
So yes, the test code fails on FC3 and works on FC2 when the actual
ip:port is changed to point to an available SMTP service.
Previous Comments:
------------------------------------------------------------------------
[2005-05-27 14:06:00] wez@php.net
Have you pasted the script that you're actually running with those
straces?
Are you really using the one from your initial post?
------------------------------------------------------------------------
[2005-05-27 09:59:17] mjpph at stardust dot fi
Also, all the kernels I've used are different versions of FC3 stock
kernels without modifications. As FC3 is quite popular Linux I'd assume
that many people will have problems with the new functions when they
adopt them. Of course it can be a kernel problem, but it can also be a
PHP problem which only exhibits on FC3 or with certain kernel settings,
but that's more your field to conclude than mine :)
------------------------------------------------------------------------
[2005-05-26 19:18:35] mjpph at stardust dot fi
Yes it works with FC2 but not with FC3, but I have tested it with
several kernels the only thing that matches is Fedora Core version.
Also socket_select and stream_select works perfectly well with other
streams/sockets, only exceptions are streams returned by
stream_socket_client() or stream_socket_server().
------------------------------------------------------------------------
[2005-05-26 18:54:13] wez@php.net
So, PHP works fine on FC2, and the same version of PHP doesn't work on
FC3?
Sounds like you have a problem with your kernel; if so, this isn't a
php bug.
------------------------------------------------------------------------
[2005-05-26 17:50:51] mjpph at stardust dot fi
Another update. I modified the test script to connect to HTTP which
doesn't output anything directly but instead waits for request from the
client. In this case the select timeouts on FC3 like it should, but
obviously doesn't return anything either as the connection doesn't
output anything. When the HTTP closes the connection the stream_select
starts behaving like with the SMTP example, looping as fast as it can.
If I change the port to SMTP with instant output, it loops the
stream_select() like a madman without the requested 5 second delay.
The working (FC2) script:
select(4, [3], [], [], {0, 5000}) = 0 (Timeout)
select(4, [3], [], [], {0, 5000}) = 1 (in [3], left {0, 4000})
select(4, [3], NULL, NULL, {60, 0}) = 1 (in [3], left {60, 0})
First it selects and timeouts when waiting for data, then it returns 1
for changed streams and the stream resource (3) as the changed stream.
So this works as expected.
Here, the non-working FC3 version:
select(4, [3], [], [], {5, 5000}) = 1 (in [3], left {4, 998000})
select(4, [3], [], [], {5, 5000}) = 1 (in [3], left {5, 5000})
select(4, [3], [], [], {5, 5000}) = 1 (in [3], left {5, 5000})
It returns the same as the FC2 (except the one with the nulls) so this
should indicate AND return PHP's stream_select() with the value of 1,
but by checking the PHP's stream_select() return value it's always 0.
It's like the system level select() works ok but the PHP function fails
to return it's results correctly? Also something that bothers with me
this conclusion is that there's not a single timeout in the FC3 case
which could indicate some other problem as well, maybe the connection
isn't established correctly?
------------------------------------------------------------------------
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/32979
--
Edit this bug report at http://bugs.php.net/?id=32979&edit=1
Thread (50 messages)
- #32979 [Opn]: socket stream opened with stream_socket_client doesnt work with stream_select
- #32979 [Opn]: socket stream opened with stream_socket_client doesnt work with stream_select
- #32979 [Opn]: socket stream opened with stream_socket_client doesnt work with stream_select
- #32979 [Opn->Fbk]: socket stream opened with stream_socket_client doesnt work with stream_select
- #32979 [Fbk->Opn]: socket stream opened with stream_socket_client doesnt work with stream_select
- #32979 [Opn->Asn]: socket stream opened with stream_socket_client doesnt work with stream_select
- #32979 [Asn->Fbk]: socket stream opened with stream_socket_client doesnt work with stream_select
- #32979 [Fbk->Opn]: socket stream opened with stream_socket_client doesnt work with stream_select
- #32979 [Opn]: socket stream opened with stream_socket_client doesnt work with stream_select
- #32979 [Opn]: socket stream opened with stream_socket_client doesnt work with stream_select
- #32979 [Opn]: socket stream opened with stream_socket_client doesnt work with stream_select
- #32979 [Opn]: socket stream opened with stream_socket_client doesnt work with stream_select
- #32979 [Opn]: socket stream opened with stream_socket_client doesnt work with stream_select
- #32979 [Opn->Fbk]: socket stream opened with stream_socket_client doesnt work with stream_select
- #32979 [Fbk->Opn]: socket stream opened with stream_socket_client doesnt work with stream_select
- #32979 [Opn->Asn]: socket stream opened with stream_socket_client doesnt work with stream_select
- #32979 [Asn]: socket stream opened with stream_socket_client doesnt work with stream_select
- #32979 [Asn]: socket stream opened with stream_socket_client doesnt work with stream_select
- #32979 [Asn]: socket stream opened with stream_socket_client doesnt work with stream_select
- #32979 [Asn]: socket stream opened with stream_socket_client doesnt work with stream_select
- #32979 [Asn]: socket stream opened with stream_socket_client doesnt work with stream_select
- #32979 [Asn->Fbk]: socket stream opened with stream_socket_client doesnt work with stream_select
- #32979 [Fbk->Opn]: socket stream opened with stream_socket_client doesnt work with stream_select
- #32979 [Opn]: socket stream opened with stream_socket_client doesnt work with stream_select
- #32979 [Opn->Fbk]: socket stream opened with stream_socket_client doesnt work with stream_select
- #32979 [Fbk->Opn]: socket stream opened with stream_socket_client doesnt work with stream_select
- #32979 [Opn]: socket stream opened with stream_socket_client doesnt work with stream_select
- #32979 [Opn]: socket stream opened with stream_socket_client doesnt work with stream_select
- #32979 [Opn]: socket stream opened with stream_socket_client doesnt work with stream_select
- #32979 [Opn->Fbk]: socket stream opened with stream_socket_client doesnt work with stream_select
- #32979 [Fbk->Opn]: socket stream opened with stream_socket_client doesnt work with stream_select
- #32979 [Opn->Fbk]: socket stream opened with stream_socket_client doesnt work with stream_select
- #32979 [Fbk->Opn]: socket stream opened with stream_socket_client doesnt work with stream_select
- #32979 [Opn]: socket stream opened with stream_socket_client doesnt work with stream_select
- #32979 [Com]: socket stream opened with stream_socket_client doesnt work with stream_select
- #32979 [Opn]: socket stream opened with stream_socket_client doesnt work with stream_select
- #32979 [Opn->Asn]: socket stream opened with stream_socket_client doesnt work with stream_select
- #32979 [Com]: socket stream opened with stream_socket_client doesnt work with stream_select
- #32979 [Asn->Fbk]: socket stream opened with stream_socket_client doesnt work with stream_select
- #32979 [NoF->Opn]: socket stream opened with stream_socket_client doesnt work with stream_select
- #32979 [Opn->Asn]: socket stream opened with stream_socket_client doesnt work with stream_select
- #32979 [Com]: socket stream opened with stream_socket_client doesnt work with stream_select
- #32979 [Com]: socket stream opened with stream_socket_client doesnt work with stream_select
- #32979 [Com]: socket stream opened with stream_socket_client doesnt work with stream_select
- #32979 [Com]: socket stream opened with stream_socket_client doesnt work with stream_select
- #32979 [Com]: socket stream opened with stream_socket_client doesnt work with stream_select
- #32979 [Com]: socket stream opened with stream_socket_client doesnt work with stream_select
- #32979 [Com]: socket stream opened with stream_socket_client doesnt work with stream_select
- #32979 [Asn->Csd]: socket stream opened with stream_socket_client doesnt work with stream_select
| « previous | php.bugs (#79608) | next » |
|---|