I don&#x27;t understand the reason for two `tcp_connect` functions. One just adds the option to pass &quot;w&quot; to the fd mode. Both functions are otherwise identical. Despite the &quot;IPv4 only&quot; comment, both structure pack with `getnameinfo()` so both appear IPv6-capable. Looks like this could be optimised to remove the first connect function.