]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Use utp.Socket.CloseNow to close a Client's uTP socket on Close
authorMatt Joiner <anacrolix@gmail.com>
Sat, 23 Jul 2016 14:24:44 +0000 (00:24 +1000)
committerMatt Joiner <anacrolix@gmail.com>
Sat, 23 Jul 2016 14:24:44 +0000 (00:24 +1000)
Fixes https://github.com/anacrolix/utp/issues/15.

client.go

index 27b340a59773f9ad1324406451e6f1000d81fe20..717604766261eab6d8a09152aebfdfb14d7b2f37 100644 (file)
--- a/client.go
+++ b/client.go
@@ -347,7 +347,7 @@ func (cl *Client) Close() {
                cl.dHT.Close()
        }
        if cl.utpSock != nil {
-               cl.utpSock.Close()
+               cl.utpSock.CloseNow()
        }
        if cl.tcpListener != nil {
                cl.tcpListener.Close()