torrent/utp.go

19 lines
440 B
Go
Raw Normal View History

2017-06-16 08:08:24 +00:00
package torrent
import (
"context"
2017-06-16 08:08:24 +00:00
"net"
)
// Abstracts the utp Socket, so the implementation can be selected from
// different packages.
type utpSocket interface {
net.PacketConn
// net.Listener, but we can't have duplicate Close.
2017-06-16 08:08:24 +00:00
Accept() (net.Conn, error)
Addr() net.Addr
// net.Dialer but there's no interface.
DialContext(ctx context.Context, network, addr string) (net.Conn, error)
// Dial(addr string) (net.Conn, error)
2017-06-16 08:08:24 +00:00
}