client.go | 8 ++++++-- diff --git a/client.go b/client.go index 1ba632aee9bdad46606e58a0b38d5197aefd05b3..8c9e64df1aad9b597512648d21b251a5213d8363 100644 --- a/client.go +++ b/client.go @@ -383,10 +383,14 @@ // Binding to the listener address and dialing via net.Dialer gives // "address in use" error. It seems it's not possible to dial out from // this address so that peers associate our local address with our // listen address. + var ( + conn net.Conn + err error + ) if false { - conn, err := net.DialTimeout("tcp", addr, dialTimeout) + conn, err = net.DialTimeout("tcp", addr, dialTimeout) } else { - conn, err := (&utp.Dialer{Timeout: dialTimeout}).Dial("utp", addr) + conn, err = (&utp.Dialer{Timeout: dialTimeout}).Dial("utp", addr) } // Whether or not the connection attempt succeeds, the half open