connection.go | 10 ++++++++-- diff --git a/connection.go b/connection.go index 752f79f42246f196a5b5376a8f1d9ee5354f3185..4655b1363e66b9d5bdc96df5569a8be3608f832b 100644 --- a/connection.go +++ b/connection.go @@ -230,8 +230,14 @@ cn.closed.Set() cn.discardPieceInclination() cn.pieceRequestOrder.Clear() if cn.conn != nil { - // TODO: This call blocks sometimes, why? - go cn.conn.Close() + go func() { + // TODO: This call blocks sometimes, why? Maybe it was the Go utp + // implementation? + err := cn.conn.Close() + if err != nil { + log.Printf("error closing connection net.Conn: %s", err) + } + }() } }