anacrolix / utp

Use anacrolix/go-libutp instead
https://github.com/anacrolix/go-libutp
Mozilla Public License 2.0
173 stars 35 forks source link

Conn `Addr` methods return udp #11

Closed whyrusleeping closed 8 years ago

whyrusleeping commented 8 years ago

I'm not sure if this is actually an issue, but the LocalAddr and RemoteAddr methods on a Conn return an address whose network identifies as udp. I think these should return utp{4,6} instead, as its more accurate.

I currently wrap the utp conn from your package to change this functionality, but if you could add it upstream that would be very helpful.

anacrolix commented 8 years ago

Will fix.

anacrolix commented 8 years ago

Do you need to be able to identify the type of net.Addr that's returned from these methods?

anacrolix commented 8 years ago

The net.Addr returned by LocalAddr and RemoteAddr, both have .Network() of type "utp/"+underlying PacketConn network. The String/Addr part is passthrough, which matches the way uTP operates.