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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Sun Jul 13 15:01:33 2025 UTC