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