|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #10426 pfsockopen resource is not client site persistent.
Submitted: 2001-04-20 14:22 UTC Modified: 2001-12-13 06:24 UTC
From: ralph at snarff dot net Assigned:
Status: Closed Package: Sockets related
PHP Version: 4.0.3 OS: Linux snarff 2.2.16-3smp #1 SMP
Private report: No CVE-ID: None
 [2001-04-20 14:22 UTC] ralph at snarff dot net
config line:  './configure' '--with-apache=/usr/local/apache_1.3.14'
                               '--with-mysql=/usr/local/mysql' '--with-ldap' '--with-imap' '--enable-ftp'
                               '--enable-yp' '--enable-track-vars'

any connections that are opened by pfsockopen are not being retained such that subsequent page calls to this script will be able to utilize the open connection (yes, the server is still connected and listening to the connection made) but php will not allow to reuse that connection.  error message:
Warning:  Supplied argument is not a valid File-Handle resource in /home/ralph/ralphschindler-www/projects/client_rs_cpen471.php on line 19

the calling form after the connection is made looks like this:
<form method=post action=client_rs_cpen471.php>
<input type=hidden name=mysocket value="Resource id #1">
<input type=hidden name=connect_string value=" 4115">
<input type=text name=command>
<input type=submit>

Is this a bug? there is scarce info on this issue on the web....

here is the code i was using to test this client app:


$connect_string = " 4115";

if (isset($connect_string)) {

  list($connect_host, $connect_port) = split(" ", $connect_string);

  /* Check to see if a connection is already open */
  if(!isset($mysocket)) {
    echo "Starting Connection on $connect_host - $connect_port<br>\n";
    $mysocket = pfsockopen($connect_host, $connect_port, $error_no, $error_str, 180);
  } else {
    echo "Using open connection on $host - $port -> $mysocket<br>\n";
    echo fread($mysocket,128);


echo $error_no . "\n\n" . $error_str;
<form method=post action=client_rs_cpen471.php>
<input type=hidden name=mysocket value="<? echo $mysocket; ?>">
<input type=hidden name=connect_string value="<? echo $connect_string; ?>">
<input type=text name=command>
<input type=submit>


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2001-11-21 12:04 UTC]
Can you please try the latest RC and see if it works

 [2001-12-13 06:24 UTC]
No feedback. Closing.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 17 02:01:30 2024 UTC