-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
At the moment, tcp_socket::connect only supports IPv4 (at least on Linux). You probably need to support IPv6, too.
From the Linux manpage, you need AF_INET6 for IPv6. This is currently a problem because open always uses AF_INET, which is v4. I don't know about other OSes. You might want to have a look at the IPV6_V6ONLY flag, which might be useful.
You shouldn't re-open sockets on connect because the user might have set options on them (potentially via native_handle()).
Related, Asio makes socket::connect open the socket if it wasn't open yet. You might consider implementing it, too. Also, Asio allows setting options after connect, so caching options to apply them further might not be the best path.
My suggestion is:
openeither setsIPV6_V6ONLYand always usesAF_INET6, or is split intoopen_v4andopen_v6.- You can set options on an open socket.
connectopens the socket if it wasn't open yet.- You need to update
connectto handle v6.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels