Doc: better description of binding tcp stream to "hostname" or "hostname:port"


Recently I found out the hard way that when I give my TcpListener.bind() argument as "localhost:9111", the socket gets bound to IPv6 [::1] because getaddrinfo on my system returns the IPv6 address first.

This is fine (my problem for not specifying my intent clearly enough), however the doc for bind needs to specify what happens with ToSocketAddrs impls that return multiple addresses (i.e. first successful one wins). It currently only says “… will be bound to the specified address.” as if only ever one address can be specified :smile:

Same is true for UdpSocket.bind() and TcpStream.connect(), although it will probably work mostly transparently in the latter case.


Bump? Anyone good at writing want to do a PR?