Skip to content

Commit 376830b

Browse files
committed
Change linger timeout
1 parent 5cb90da commit 376830b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

pkg/scan/socks5/socks5.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,10 @@ func (s *Scanner) Scan(ctx context.Context, r *scan.Request) (result scan.Result
7777
return
7878
}
7979
defer conn.Close()
80-
// tell the operating system to discard any unsent or unacknowledged data on Close()
81-
// it will release all socket resources and send RST packet, fine for the scan
82-
if err = conn.(*net.TCPConn).SetLinger(0); err != nil {
80+
// tell the operating system to discard any unsent or unacknowledged data on Close(),
81+
// after a maximum of 1 second it will release all socket resources and send RST packet,
82+
// fine for the scan
83+
if err = conn.(*net.TCPConn).SetLinger(1); err != nil {
8384
return
8485
}
8586

0 commit comments

Comments
 (0)