From 689fe85134038d4c15552826db326676eb1d5420 Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Thu, 28 Aug 2014 10:06:57 +1000 Subject: [PATCH] Disable TCP linger for peer connections --- client.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/client.go b/client.go index 2dc4acfa..444fc176 100644 --- a/client.go +++ b/client.go @@ -495,6 +495,9 @@ func (pc peerConn) Read(b []byte) (n int, err error) { } func (me *Client) runConnection(sock net.Conn, torrent *torrent, discovery peerSource) (err error) { + if tcpConn, ok := sock.(*net.TCPConn); ok { + tcpConn.SetLinger(0) + } defer sock.Close() me.mu.Lock() me.handshaking++ -- 2.48.1