Edit report at https://bugs.php.net/bug.php?id=35745&edit=1
ID: 35745 Updated by: yohg...@php.net Reported by: gavin dot brown at uk dot com Summary: Status of persistent socket connections in stream_get_meta_data -Status: Open +Status: Wont fix Type: Feature/Change Request -Package: Feature/Change Request +Package: *General Issues Operating System: All PHP Version: 5.1.1 Block user comment: N Private report: N New Comment: 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. Previous Comments: ------------------------------------------------------------------------ [2005-12-20 14:48:05] 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. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=35745&edit=1