package torrent
-type peerNetworks struct {
- tcp4, tcp6 bool
- utp4, utp6 bool
-}
+import "strings"
-func handleErr(h func(), fs ...func() error) error {
- for _, f := range fs {
- err := f()
- if err != nil {
- h()
- return err
- }
+func LoopbackListenHost(network string) string {
+ if strings.IndexByte(network, '4') != -1 {
+ return "127.0.0.1"
+ } else {
+ return "::1"
}
- return nil
}