|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2020-04-22 07:15 UTC] requinix@php.net
-Status: Open
+Status: Feedback
[2020-04-22 07:15 UTC] requinix@php.net
[2020-04-22 09:21 UTC] slawek1211 at gmail dot com
-Status: Feedback
+Status: Open
[2020-04-22 09:21 UTC] slawek1211 at gmail dot com
[2020-04-22 09:23 UTC] slawek1211 at gmail dot com
-Status: Open
+Status: Closed
[2020-04-22 09:23 UTC] slawek1211 at gmail dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 14:00:01 2025 UTC |
Description: ------------ For client-server connections using persistent sockets it's sometimes a desirable functionality to send some initialization data when the connection is initially opened. Fore example to submit feature set supported by client (like compression algorithms supported or client version). As these persistent sockets are managed by PHP it'd be nice to have some function which could be used to assign user data to given socket. This user data would reset when php backend calls connect C function. Or at least some function which would report bytes received and send on $s. This way user can detect if he got new or already estabilished connection in $s. Test script: --------------- $errno = $errstr = 0; $opt_connect_timeout = 5; $s = pfsockopen('127.0.0.1', '80', $errno, $errstr, $opt_connect_timeout); Expected result: ---------------- Being able to write something like this $errno = $errstr = 0; $opt_connect_timeout = 5; $s = pfsockopen('127.0.0.1', '80', $errno, $errstr, $opt_connect_timeout); if (get_socket_user_data($s) != 'i') { ... send connection initialization data to server ... set_socket_user_data($s, 'i'); }