Fix utp.Socket leak in test
This commit is contained in:
parent
87433b00ba
commit
8d581ce7f2
|
@ -160,10 +160,9 @@ func TestUTPRawConn(t *testing.T) {
|
|||
}
|
||||
}()
|
||||
// Connect a UTP peer to see if the RawConn will still work.
|
||||
utpPeer, err := func() *utp.Socket {
|
||||
s, _ := utp.NewSocket("")
|
||||
return s
|
||||
}().Dial(fmt.Sprintf("localhost:%d", util.AddrPort(l.Addr())))
|
||||
s, _ := utp.NewSocket("")
|
||||
defer s.Close()
|
||||
utpPeer, err := s.Dial(fmt.Sprintf("localhost:%d", missinggo.AddrPort(l.Addr())))
|
||||
if err != nil {
|
||||
t.Fatalf("error dialing utp listener: %s", err)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue