]> Sergey Matveev's repositories - btrtrc.git/blob - utp.go
Use DialContext instead of DialTimeout with utp
[btrtrc.git] / utp.go
1 package torrent
2
3 import (
4         "context"
5         "net"
6         "time"
7 )
8
9 // Abstracts the utp Socket, so the implementation can be selected from
10 // different packages.
11 type utpSocket interface {
12         Accept() (net.Conn, error)
13         Addr() net.Addr
14         Close() error
15         LocalAddr() net.Addr
16         ReadFrom([]byte) (int, net.Addr, error)
17         SetDeadline(time.Time) error
18         SetWriteDeadline(time.Time) error
19         SetReadDeadline(time.Time) error
20         WriteTo([]byte, net.Addr) (int, error)
21         DialContext(ctx context.Context, addr string) (net.Conn, error)
22         Dial(addr string) (net.Conn, error)
23 }