Skip to content

Conversation

kralicky
Copy link
Contributor

Commit Message: userspace socket: allow providing an existing PassthroughState when creating IoHandle pair
Additional Description:
This change is to allow extensions to provide their own implementation of PassthroughState and/or derive from the default PassthroughStateImpl when creating userspace IoHandle pairs with the IoHandleFactory.

Risk Level: Low; changes are backwards compatible
Testing: Unit tests added
Docs Changes:
Release Notes:
Platform Specific Features:
[Optional Runtime guard:]
[Optional Fixes #Issue]
[Optional Fixes commit #PR or SHA]
[Optional Deprecated:]
[Optional API Considerations:]

Copy link
Contributor

@kyessenov kyessenov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Would be useful to know why you want this functionality.

@kyessenov kyessenov merged commit 9bd5745 into envoyproxy:main Aug 26, 2025
24 checks passed
wtzhang23 pushed a commit to wtzhang23/envoy that referenced this pull request Aug 27, 2025
…reating IoHandle pair (envoyproxy#40748)

Commit Message: userspace socket: allow providing an existing
PassthroughState when creating IoHandle pair
Additional Description:
This change is to allow extensions to provide their own implementation
of PassthroughState and/or derive from the default PassthroughStateImpl
when creating userspace IoHandle pairs with the IoHandleFactory.

Risk Level: Low; changes are backwards compatible
Testing: Unit tests added
Docs Changes:
Release Notes:
Platform Specific Features:
[Optional Runtime guard:]
[Optional Fixes #Issue]
[Optional Fixes commit #PR or SHA]
[Optional Deprecated:]
[Optional [API
Considerations](https://github.com/envoyproxy/envoy/blob/main/api/review_checklist.md):]

Signed-off-by: Joe Kralicky <[email protected]>
@kralicky
Copy link
Contributor Author

My use case involves creating a pair of userspace socket handles in an upstream Network::SocketInterface::socket(), then passing one of them to a different thread to connect it to a data stream coming from a separate downstream client. The implementation of PassthroughState used here adds thread safety and allows registering a callback when its state changes (e.g. created->initialized).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants