add
This commit is contained in:
parent
7b88a879e1
commit
dc02a58284
@ -226,7 +226,7 @@ func (p *Client) AcceptTcpConn(conn *net.TCPConn) {
|
|||||||
|
|
||||||
left := common.MinOfInt(clientConn.fm.GetSendBufferLeft(), len(bytes))
|
left := common.MinOfInt(clientConn.fm.GetSendBufferLeft(), len(bytes))
|
||||||
if left > 0 {
|
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])
|
n, err := conn.Read(bytes[0:left])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
nerr, ok := err.(net.Error)
|
nerr, ok := err.(net.Error)
|
||||||
@ -266,7 +266,7 @@ func (p *Client) AcceptTcpConn(conn *net.TCPConn) {
|
|||||||
|
|
||||||
if clientConn.fm.GetRecvBufferSize() > 0 {
|
if clientConn.fm.GetRecvBufferSize() > 0 {
|
||||||
rr := clientConn.fm.GetRecvReadLineBuffer()
|
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)
|
n, err := conn.Write(rr)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
nerr, ok := err.(net.Error)
|
nerr, ok := err.(net.Error)
|
||||||
|
@ -192,7 +192,7 @@ func (p *Server) RecvTCP(conn *ServerConn, id string, src *net.IPAddr) {
|
|||||||
|
|
||||||
left := common.MinOfInt(conn.fm.GetSendBufferLeft(), len(bytes))
|
left := common.MinOfInt(conn.fm.GetSendBufferLeft(), len(bytes))
|
||||||
if left > 0 {
|
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])
|
n, err := conn.tcpconn.Read(bytes[0:left])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
nerr, ok := err.(net.Error)
|
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 {
|
if conn.fm.GetRecvBufferSize() > 0 {
|
||||||
rr := conn.fm.GetRecvReadLineBuffer()
|
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)
|
n, err := conn.tcpconn.Write(rr)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
nerr, ok := err.(net.Error)
|
nerr, ok := err.(net.Error)
|
||||||
|
Loading…
Reference in New Issue
Block a user