#24101 [Fbk->Opn]: socket_select call is blocking and never returning
| From: | wzaccone at telcordia dot com | Date: | Tue, 10 Jun 2003 14:23:26 +0000 |
| Subject: | #24101 [Fbk->Opn]: socket_select call is blocking and never returning | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-41610@lists.php.net to get a copy of this message | ||
ID: 24101
User updated by: wzaccone at telcordia dot com
Reported By: wzaccone at telcordia dot com
-Status: Feedback
+Status: Open
Bug Type: Sockets related
Operating System: Solaris 5.8 / Sparc
PHP Version: 4.3.2
New Comment:
thank you for the info.. we were previously using socket_select and
fread successfully with 4.1.2 and went live with an application doing
so. For our next release, we upgraded to PHP 4.3.2 and it stopped
working. Can I assume that this behavior has changed with 4.3.2??
therefore we must migrate to using streams_select to upgrade to 4.3.2?
Previous Comments:
------------------------------------------------------------------------
[2003-06-10 09:19:12] wez@php.net
You can't use fread() on sockets returned from the sockets extension,
and likewise, you can use socket_select() on streams returned from
fopen() or fsockopen().
Perhaps you meant to use stream_select() instead?
------------------------------------------------------------------------
[2003-06-10 09:02:26] wzaccone at telcordia dot com
function readMsgsFromHosts($sockets){
set_time_limit(0);
$numSockets = count($sockets);
$keys = array_keys($sockets);
$socketsCopy = Array();
foreach ($keys as $key){
$socketsCopy[$key] = $sockets[$key];
}
if (@socket_select($socketsCopy, $w = NULL, $e = NULL, $tv = NULL)
!== FALSE){
foreach($socketsCopy as $sock){
$string = fread($sock, $readAmount);
------------------------------------------------------------------------
[2003-06-09 23:40:31] sniper@php.net
Could you give a complete (but short, please) script
that shows this problem clearly..? (can't reproduce, but I'm propably
missing some part here..)
------------------------------------------------------------------------
[2003-06-09 14:02:38] wzaccone at telcordia dot com
we upgraded our application from php 4.1.2 to 4.3.2 and are testing.
and found the following code no longer works:
if (@socket_select($socketsCopy, $w = NULL, $e = NULL, $tv = NULL) !==
FALSE){
foreach($socketsCopy as $sock){
The socket_select call appears to be never returning with php 4.3.2..
code worked correctly with 4.1.2.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=24101&edit=1