general: remove unnecessary SetKeepAlive

This commit is contained in:
nadoo committed 2018-08-03 19:27:47 +08:00
1 parent 6cdfbc3552
commit 1f8a3cdf53
7 files changed
+2 -25

No files matched your search

-8
View File
@@ -234,10 +234,6 @@ func (s *SOCKS5) Dial(network, addr string) (net.Conn, error) {
return nil, err
}
if c, ok := c.(*net.TCPConn); ok {
c.SetKeepAlive(true)
}
if err := s.connect(c, addr); err != nil {
c.Close()
return nil, err
@@ -254,10 +250,6 @@ func (s *SOCKS5) DialUDP(network, addr string) (pc net.PacketConn, writeTo net.A
return nil, nil, err
}
if c, ok := c.(*net.TCPConn); ok {
c.SetKeepAlive(true)
}
// send VER, NMETHODS, METHODS
c.Write([]byte{5, 1, 0})