This commit turns all dial logs into log.Events.
Everything's great except for one problem:
The LoggableMap I'm using does not print out things
correctly. I gave it peer.IDs, and Multiaddrs
and both got logged as nothing `{}` (didn't even call
their String() methods!) So, for now, this function
encodes it when called... This is wrong and should be
fixed before being merged in. Otherwise we will be
constantly encoding peer.IDs and Multiaddrs without
needing to.
@briantigerchow how do you suggest doing this?
I don't know my way around your Loggable.
This commit cleans up the reuse port setup, and fixes a problem:
make sure to filter addrs out that we simply cannot dial with
(e.g. loopback -> non-loopback, or linklocal -> nonlinklocal)
Instead of erroring out, which would break the listener,
we instead log a message and continue. This is not an error,
the internet is a place with lots of probing + connection
failures.
This should handle early breakages, where a failing connection
would take out the listener entirely.
There are probably other errors we should be handling here,
like secure connection failures.
This commit makes all network tests use ZeroLocalTCPAddress
as the initial peer address, and then relies on
net.ListenAddresses()
This should get rid of the tcp addr clash problems.