php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #35745 Status of persistent socket connections in stream_get_meta_data
Submitted: 2005-12-20 14:48 UTC Modified: 2013-08-01 22:36 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: gavin dot brown at uk dot com Assigned:
Status: Wont fix Package: *General Issues
PHP Version: 5.1.1 OS: All
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: gavin dot brown at uk dot com
New email:
PHP Version: OS:

 

 [2005-12-20 14:48 UTC] gavin dot brown at uk dot com
Description:
------------
Currently, there is now way to determine if the pfsockopen() created a new connection or used an existing connection.


Expected result:
----------------
This information is very important for some protocols (specifically, the EPP protocol, RFC 3730, and its TCP transport specification in RFC 3734), which uses a stateful session management system.

I'd suggest something like this:

<?php

$sock = pfsockopen($host, $port, $etc);

$data = stream_get_meta_data($sock);

print $data[persistent];

?>

the value of $data[persistent] might be one of "new" or "existing", depending on whether the previous pfsockopen() had to create a new connection, or was able to reuse an existing one.

This would be very useful for protocols like EPP (see RFC 3734) and IMAP, which are stateful, and for which negotiation and authentication are done once, upon connection.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-08-01 22:36 UTC] yohgaki@php.net
-Status: Open +Status: Wont fix -Package: Feature/Change Request +Package: *General Issues
 [2013-08-01 22:36 UTC] yohgaki@php.net
The idea of persistent of connection is "connect always, but if there isn't 
connection yet, then make connection".

If you need persistent connection, use pfsockopen() always.

Persistent connection is managed by connection ID internally, so it's possible 
to make

pfsock_is_open() - return TRUE if already opened.

or something like this.

If you still feel you would like to have this, reopen this report.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun May 05 10:01:31 2024 UTC