You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add IPv6 socket support with dual-stack, lazy fd creation, and generic socket options
New public types:
- tcp: compiled protocol type (family/type/protocol without
platform headers); inline native_tcp variant for zero-overhead
- socket_option: type-safe wrappers (no_delay, keep_alive,
reuse_address, reuse_port, v6_only, linger, send/receive
buffer sizes); inline native_socket_option variant
Acceptor API:
- Split monolithic listen(endpoint) into open() / bind() / listen()
so socket options can be set between open and listen
- Add convenience constructor: tcp_acceptor(ctx, ep, backlog)
for the common open+reuse_address+bind+listen pattern
- Add set_option() / get_option() on tcp_acceptor and its
implementation interface (all 4 backends)
Socket changes:
- tcp_socket::open() takes tcp protocol type (defaults to v4)
- connect() on a closed socket auto-opens with the endpoint's
address family via open(tcp::v6()) / open(tcp::v4())
- Service layer passes (family, type, protocol) triple through
socket_service, acceptor_service, and all 4 backends; backends
use the caller-provided triple in ::socket() / WSASocketW()
- IOCP backend stores address family in win_socket_internal
for the ephemeral bind required by ConnectEx
- Delete move assignment on io_read_stream / io_write_stream
to prevent double-move of virtual base in diamond hierarchy
IPv6 support across all backends:
- Sockets: IPV6_V6ONLY=1 (v6-only by default, user can clear)
- Acceptors: IPV6_V6ONLY=0 (dual-stack by default)
- endpoint_convert: IPv4-mapped IPv6 conversion when an IPv4
endpoint connects through an AF_INET6 socket
Tests:
- IPv6 connect, read/write, v6_only option, dual-stack connect
- Lazy open (connect auto-opens), preserves pre-set options
- Acceptor: open/bind/listen lifecycle, set/get_option,
convenience constructor, IPv6 accept
- All existing tests updated for the new open/bind/listen API
0 commit comments