From 642181af6a6fa88f19c43ddd98db228c4a7ab283 Mon Sep 17 00:00:00 2001 From: Kevin Souza Date: Tue, 5 Nov 2024 14:20:19 -0300 Subject: [PATCH] disabling keepalive --- hagelslag.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/hagelslag.go b/hagelslag.go index 6ccab55..09162e1 100644 --- a/hagelslag.go +++ b/hagelslag.go @@ -100,10 +100,14 @@ func (h Hagelslag) worker(ips <-chan string, wg *sync.WaitGroup) { port := h.Scanner.Port() network := h.Scanner.Network() - dialer := net.Dialer{Timeout: 1 * time.Second} + dialer := net.Dialer{ + KeepAlive: -1, + Timeout: 1 * time.Second, + } + collection := client.Database("hagelslag").Collection(name) - // Responsible for controlling how many tasks can be processed + // Responsible for controlling how many tasks can be processed by a worker semaphore := make(chan struct{}, h.TasksPerThread) for ip := range ips {