2017-06-16 08:08:24 +00:00
|
|
|
package torrent
|
|
|
|
|
|
|
|
import (
|
2017-08-16 05:35:17 +00:00
|
|
|
"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 {
|
2018-02-05 07:03:27 +00:00
|
|
|
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
|
2018-02-05 07:03:27 +00:00
|
|
|
// net.Dialer but there's no interface.
|
2018-02-15 23:46:11 +00:00
|
|
|
DialContext(ctx context.Context, network, addr string) (net.Conn, error)
|
|
|
|
// Dial(addr string) (net.Conn, error)
|
2017-06-16 08:08:24 +00:00
|
|
|
}
|