2
0
mirror of synced 2025-02-23 22:28:11 +00:00

Log errors closing connection net.Conn's

This commit is contained in:
Matt Joiner 2017-09-18 12:16:59 +10:00
parent 639c49f1ae
commit c85aac6383

View File

@ -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)
}
}()
}
}