2017-06-16 16:08:24 +08:00
|
|
|
// +build !cgo
|
|
|
|
|
|
|
|
package torrent
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/anacrolix/utp"
|
|
|
|
)
|
|
|
|
|
|
|
|
func NewUtpSocket(network, addr string) (utpSocket, error) {
|
2017-09-13 22:25:29 +08:00
|
|
|
s, err := utp.NewSocket(network, addr)
|
|
|
|
if s == nil {
|
|
|
|
return nil, err
|
|
|
|
} else {
|
|
|
|
return s, err
|
|
|
|
}
|
2017-06-16 16:08:24 +08:00
|
|
|
}
|