]> Sergey Matveev's repositories - btrtrc.git/blob - utp_libutp.go
Remove old-style build tags
[btrtrc.git] / utp_libutp.go
1 //go:build cgo && !disable_libutp
2
3 package torrent
4
5 import (
6         utp "github.com/anacrolix/go-libutp"
7 )
8
9 func NewUtpSocket(network, addr string, fc firewallCallback) (utpSocket, error) {
10         s, err := utp.NewSocket(network, addr)
11         if s == nil {
12                 return nil, err
13         }
14         if err != nil {
15                 return s, err
16         }
17         if fc != nil {
18                 s.SetFirewallCallback(utp.FirewallCallback(fc))
19         }
20         return s, err
21 }