update tcp.go

This commit is contained in:
Jason
2019-08-11 21:07:06 +08:00
parent d571cbef78
commit 6d50f90315
2 changed files with 11 additions and 2 deletions

View File

@@ -20,6 +20,13 @@ func tcpCloseRead(conn net.Conn) {
}
}
func tcpCloseWrite(conn net.Conn) {
if c, ok := conn.(duplexConn); ok {
log.Warnf("ok!++++")
c.CloseWrite()
}
}
func tcpKeepAlive(conn net.Conn) {
if tcp, ok := conn.(*net.TCPConn); ok {
tcp.SetKeepAlive(true)