github.com/anacrolix/torrent@v1.61.0/utp.go (about) 1 package torrent 2 3 import ( 4 "context" 5 "net" 6 ) 7 8 // Abstracts the utp Socket, so the implementation can be selected from 9 // different packages. 10 type utpSocket interface { 11 net.PacketConn 12 // net.Listener, but we can't have duplicate Close. 13 Accept() (net.Conn, error) 14 Addr() net.Addr 15 // net.Dialer but there's no interface. 16 DialContext(ctx context.Context, network, addr string) (net.Conn, error) 17 // Dial(addr string) (net.Conn, error) 18 }