2021-07-14 12:35:52 +08:00
|
|
|
//go:build !cgo || disable_libutp
|
2017-12-06 08:56:26 +08:00
|
|
|
// +build !cgo disable_libutp
|
2017-06-16 16:08:24 +08:00
|
|
|
|
|
|
|
package torrent
|
|
|
|
|
|
|
|
import (
|
2022-02-15 13:18:32 +08:00
|
|
|
"github.com/anacrolix/log"
|
2017-06-16 16:08:24 +08:00
|
|
|
"github.com/anacrolix/utp"
|
|
|
|
)
|
|
|
|
|
2022-02-15 13:18:32 +08:00
|
|
|
func NewUtpSocket(network, addr string, _ firewallCallback, _ log.Logger) (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
|
|
|
}
|