diff --git a/client.go b/client.go index 8d1858d..03e3342 100644 --- a/client.go +++ b/client.go @@ -226,7 +226,7 @@ func (p *Client) AcceptTcpConn(conn *net.TCPConn) { left := common.MinOfInt(clientConn.fm.GetSendBufferLeft(), len(bytes)) if left > 0 { - conn.SetReadDeadline(time.Now().Add(time.Millisecond * 10)) + conn.SetReadDeadline(time.Now().Add(time.Millisecond * 1)) n, err := conn.Read(bytes[0:left]) if err != nil { nerr, ok := err.(net.Error) @@ -266,7 +266,7 @@ func (p *Client) AcceptTcpConn(conn *net.TCPConn) { if clientConn.fm.GetRecvBufferSize() > 0 { rr := clientConn.fm.GetRecvReadLineBuffer() - conn.SetWriteDeadline(time.Now().Add(time.Millisecond * 10)) + conn.SetWriteDeadline(time.Now().Add(time.Millisecond * 1)) n, err := conn.Write(rr) if err != nil { nerr, ok := err.(net.Error) diff --git a/server.go b/server.go index 5711f33..badf6b5 100644 --- a/server.go +++ b/server.go @@ -192,7 +192,7 @@ func (p *Server) RecvTCP(conn *ServerConn, id string, src *net.IPAddr) { left := common.MinOfInt(conn.fm.GetSendBufferLeft(), len(bytes)) if left > 0 { - conn.tcpconn.SetReadDeadline(time.Now().Add(time.Millisecond * 10)) + conn.tcpconn.SetReadDeadline(time.Now().Add(time.Millisecond * 1)) n, err := conn.tcpconn.Read(bytes[0:left]) if err != nil { nerr, ok := err.(net.Error) @@ -231,7 +231,7 @@ func (p *Server) RecvTCP(conn *ServerConn, id string, src *net.IPAddr) { if conn.fm.GetRecvBufferSize() > 0 { rr := conn.fm.GetRecvReadLineBuffer() - conn.tcpconn.SetWriteDeadline(time.Now().Add(time.Millisecond * 10)) + conn.tcpconn.SetWriteDeadline(time.Now().Add(time.Millisecond * 1)) n, err := conn.tcpconn.Write(rr) if err != nil { nerr, ok := err.(net.Error)