|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #29569 stream_set_timeout does not allow you to disable timeout
Submitted: 2004-08-08 06:00 UTC Modified: 2004-08-08 06:29 UTC
From: rob at rem5 dot com Assigned:
Status: Not a bug Package: Feature/Change Request
PHP Version: 5.0.0 OS: NIX 2.4.x
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.
Block user comment
Status: Assign to:
Bug Type:
From: rob at rem5 dot com
New email:
PHP Version: OS:


 [2004-08-08 06:00 UTC] rob at rem5 dot com
when trying to keep a stream open using stream_set_timeout it will not allow the connection to stay open. I tried setting it to 0.. as well as 9999999999999999999999999. However it will not stay open more than 30 seconds.

Reproduce code:
#!/usr/local/php5/bin/php -qn
$socket = stream_socket_server("tcp://", $errno, $errstr);
stream_set_timeout($socket, 99999999999999999999999999999999999999);
if (!$socket) {
  echo "$errstr ($errno)<br />\n";
} else {
  while ($conn = stream_socket_accept($socket)) {
   fwrite($conn, "Simple Echo Using stream_socket_server() in PHP");
   $foo = fgets($conn);
   fwrite($conn, $foo);

Expected result:
stream_socket_server() should stay open and accepting connections.

Actual result:
craps out after 30 secs


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-08-08 06:29 UTC] rob at rem5 dot com
error with my script and my head.
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Sun May 22 20:05:44 2022 UTC