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