nictuku/nettools — pull request #3 by spikebike (2014-09-19 09:10:39+00:00)
Title: Adding IPv6 to DottedPortToBinary

On my machine these changes increased the IP -> string conversion from 281ns to 329ns. However it's using more of the standard go libraries and is IPv6 compatible.

It was actually nice to change nettools instead of messing with the larger DHT package. I did go down the path of changing PeerStore to use net.UDPAddr instead of strings, but I had forgotten that you often need the string version anyways. Seemed silly to change PeerStore to UDPAddr then after to convert to string every time you send/receive a peer message.

Your tests still pass, I don't think this will break anything, still have to add the IPv6 protocol handling to DHT to make this worthwhile. I added some IPv6 tests (the formats for IPv6 are more varied than Ipv4. These changes allow PeerStore to handle IPv6 addressses I believe.

Comments welcome.