php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #25104 socket_select only selects first socket
Submitted: 2003-08-15 19:11 UTC Modified: 2003-08-16 04:28 UTC
From: w at ff dot st Assigned:
Status: Not a bug Package: Sockets related
PHP Version: 4.3.1 OS: Windows
Private report: No CVE-ID: None
 [2003-08-15 19:11 UTC] w at ff dot st
Description:
------------
I'm writing "application" scripts with PHP (such as a FTP server). Usually I run them under Linux.
I tried to run a script on windows, and after some debugging, I found that socket_select() was returning only when the first socket of the read array has data.

Under linux, it works as expected, but under windows, I had to find a way to stop using 100% CPU (usleep not available & socket_select returning instantly if I give all null socket arrays and a non-null timeout).

I'll try with the stream_select() function. It won't change that socket_select() is bogus, that's why I'm posting that.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-08-15 20:24 UTC] sniper@php.net
Not nearly enough data to process this report.
(try reading the bug submitting guidelines first:
http://bugs.php.net/how-to-report.php)

 [2003-08-16 04:18 UTC] w at ff dot st
After some tries, I found that I was using PHP 4.3.1 instead of 4.3.2 (path error for php.exe).

Now the code works well under linux or windows (only the telnet bug : when you use "quit" with telnet the disconnection isn't detected by socket_read() but socket_select() will return immediatly. Seems to be a freature of socket_read : see doc & you'll see that socket_read can return an empty string.).
 [2003-08-16 04:27 UTC] magnus@php.net
Not a bug => Bogus
 [2003-08-16 04:28 UTC] eru@php.net
User Error -> Bogus
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 01:01:28 2024 UTC