php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #1725 fgets() in non_bloking mode won't return
Submitted: 1999-07-16 03:49 UTC Modified: 1999-07-16 06:47 UTC
From: wico at cnh dot nl Assigned:
Status: Closed Package: Misbehaving function
PHP Version: 3.0.11 OS: Redhat 6.0 kernel 2.2.10
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: wico at cnh dot nl
New email:
PHP Version: OS:

 

 [1999-07-16 03:49 UTC] wico at cnh dot nl
This script connect's as a server to a irc server ith blocking mode off so it can do otherthings while in the loop
But with connecting... it will hang after reading... and only when i let the irc server push many many data it will continu to function normal... 

<?
	echo "plop<BR>\n"; flush();
	$fp = fsockopen("irc.net.local", 4400);

	if ($fp) {
		fputs($fp,"PASS :wisky\nSERVER Wico.net.local 1 932044265 932044265 J10 A 0 :plop\n");
		set_socket_blocking($fp, 0);
		while (1 < 2) {
			sleep(1);
			echo "reading....";
			flush();
			$out = fgets($fp, 2);
			echo "done<BR>\n";                     /* should come here directly, but isn't */
			flush();                                        /* It's waiting till fgets is finished */
			if ($out) {
				echo "boe: '$out'<BR>\n";
				flush();
			}
		}
	}
?>

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1999-07-16 06:47 UTC] sas at cvs dot php dot net
fixed in CVS. You might try out, if it works for you. See http://cvs.php.net for more information
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 18 00:01:33 2024 UTC