Stdlib: pfsockopen() persistent TCP sockets (#3384) - #7957
Merged
Merged
Conversation
Delegate connect/persistence to host pfsockopen and adopt into VmFs; add host-resource refcounting so duplicate persistent handles fclose safely. Co-authored-by: Cursor <cursoragent@cursor.com>
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pfsockopen()inext/standard/pfsockopen.phpby delegating connect + persistence to host\pfsockopen()and adopting the stream intoVmFs(php-srcext/standard/fsock.cparity).VmFshost-resource refcounting so repeated persistent opens sharing the same underlying host streamfclose()safely (required when host returns identical resource for same host:port).PfsockopenBuiltinTest(including ephemeral-server reuse probe).php-src reference
ext/standard/fsock.c—PHP_FUNCTION(pfsockopen)main/streams/streams.c— persistent stream list (php_stream_popen)PHP implementation
ext/standard/pfsockopen.php— VM builtinext/standard/VmPersistentSocket.php— stream URI helperext/standard/VmFs.php— shared host-resource refcount on adopt/fcloseVerification
Closes #3384
Made with Cursor