add keepAlive option for udp Listener

This commit is contained in:
ginuerzh committed 2022-04-03 22:23:27 +08:00
1 parent fc1e6e8ff2
commit 6340d5198f
9 files changed
+109 -79

No files matched your search

+4 -1
View File
@@ -197,7 +197,10 @@ func (ex *exchanger) exchange(ctx context.Context, msg []byte) ([]byte, error) {
c = tls.Client(c, ex.options.tlsConfig)
}
conn := &dns.Conn{Conn: c}
conn := &dns.Conn{
UDPSize: 1024,
Conn: c,
}
if _, err = conn.Write(msg); err != nil {
return nil, err