From 717a8179f5c994d292bf39e111b5c2f33f07197b Mon Sep 17 00:00:00 2001 From: Miek Gieben Date: Sat, 19 Oct 2013 22:00:17 +0100 Subject: [PATCH] Use recommendation from RFC5966 and set idle timeout much lower --- client.go | 2 +- server.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client.go b/client.go index 85226074..a8ac4b8b 100644 --- a/client.go +++ b/client.go @@ -13,7 +13,7 @@ import ( ) const dnsTimeout time.Duration = 2 * 1e9 -const tcpIdleTimeout time.Duration = 1 * time.Minute +const tcpIdleTimeout time.Duration = 8 * time.Second // A Conn represents a connection to a DNS server. type Conn struct { diff --git a/server.go b/server.go index d510d0a0..542ccac8 100644 --- a/server.go +++ b/server.go @@ -195,7 +195,7 @@ type Server struct { UDPSize int // default buffer size to use to read incoming UDP messages ReadTimeout time.Duration // the net.Conn.SetReadTimeout value for new connections WriteTimeout time.Duration // the net.Conn.SetWriteTimeout value for new connections - IdleTimeout func() time.Duration // TCP idle timeout for multilpe queries, if nil, defaults to 1 time.Minute (RFC 5966) + IdleTimeout func() time.Duration // TCP idle timeout for multilpe queries, if nil, defaults to 8 * time.Second (RFC 5966) TsigSecret map[string]string // secret(s) for Tsig map[] }