Log errors closing connection net.Conn's
This commit is contained in:
parent
639c49f1ae
commit
c85aac6383
@ -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)
|
||||
}
|
||||
}()
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user