From c85aac6383360b91e852b6fa843b747798f88794 Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Mon, 18 Sep 2017 12:16:59 +1000 Subject: [PATCH] Log errors closing connection net.Conn's --- connection.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/connection.go b/connection.go index 752f79f4..4655b136 100644 --- a/connection.go +++ b/connection.go @@ -230,8 +230,14 @@ func (cn *connection) Close() { 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) + } + }() } } -- 2.48.1