-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Description
Summary
tcp_socket does not expose a bind() method, while udp_socket and tcp_acceptor both do. The underlying infrastructure (reactor_basic_socket::do_bind()) supports it for all socket types — it's just not wired through the TCP path.
Current state
tcp_socket |
udp_socket |
tcp_acceptor |
|
|---|---|---|---|
open() |
Yes | Yes | Yes |
bind() |
No | Yes | Yes |
udp_servicehasbind_datagram()virtual —tcp_servicehas no equivalentreactor_basic_socket::do_bind()works for both TCP and UDP- Native variants (
native_tcp_socket,native_udp_socket) inherit non-async ops from the type-erased base, so the gap propagates uniformly
Impact
A TCP client that needs to bind to a specific local address/port before connecting (multi-homed hosts, source-port pinning) cannot do so at any API level.
Proposed fix
- Add
bind_socket()totcp_service(virtual interface) - Implement in all backends (delegate to
do_bind()) - Expose
bind(endpoint)ontcp_socket native_tcp_socketinherits it automatically
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels