php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #10320 Read fails with non_blocking socket.
Submitted: 2001-04-13 14:49 UTC Modified: 2001-06-12 01:12 UTC
From: cyberlotnet at hotmail dot com Assigned:
Status: Closed Package: Sockets related
PHP Version: 4.0.4pl1 OS: Redhat 6.2
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
50 - 38 = ?
Subscribe to this entry?

 
 [2001-04-13 14:49 UTC] cyberlotnet at hotmail dot com
This is a small part of my script.. EVERYTHING works except
for the read.. and that works soon as I take out the
non_blocking, however my script doesnt work properly then so
thats not a valid solution..

The writeout is just a write that allows me to specifiy a
single connection or in this case "all" which sends to all..
That works.. but the read.. never returns anything, its like
its not buffering input and holding it in the socket till I
can read it.

function newlogins() {
    global $connectbuff, $sock, $buffcount, $logonmess;
    if (($connectbuff[$buffcount] = accept_connect($sock)) >
-1) {
        writeout ($connectbuff[$buffcount], $logonmess);
        $send = "You are the " . $buffcount . " player to
log on\n";
        writeout ($connectbuff[$buffcount], $send);
        $send = "Enter a username : ";
        writeout ($connectbuff[$buffcount], $send);
        $buffcount++;
    }

        read($connectbuff[0],$buff,4096);
    writeout($connectbuff,$buff,"all");
}

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-06-12 01:12 UTC] sniper@php.net
Please update to PHP 4.0.5 at least. Or if that does not
work either, try the PHP 4.0.6RC3 from:

http://www.php.net/~andi/php-4.0.6RC3.tar.gz

And if you still have problems, please include a short
but complete example script into this report which 
can be used to reproduce this.

--Jani

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 09:01:29 2024 UTC