ing
This commit is contained in:
parent
170438c0d0
commit
22eb6d7703
|
@ -32,10 +32,10 @@ func (crwch *ClientReadWriteCloseHandlers) ReadResponse(clientCTX client.ClientC
|
|||
|
||||
_, buf, err := soc.ReadMessage()
|
||||
if nil != err {
|
||||
if websocket.IsUnexpectedCloseError(err) {
|
||||
return nil, io.EOF
|
||||
if !websocket.IsUnexpectedCloseError(err) {
|
||||
logging.Logger().Errorf("RPC: %v", err)
|
||||
}
|
||||
return nil, err
|
||||
return nil, io.EOF
|
||||
}
|
||||
|
||||
return codec.NewResponse(buf)
|
||||
|
@ -56,9 +56,9 @@ func (crwch *ClientReadWriteCloseHandlers) WriteRequest(clientCTX client.ClientC
|
|||
wErr = soc.WriteMessage(websocket.TextMessage, buf)
|
||||
if nil != wErr {
|
||||
if websocket.IsUnexpectedCloseError(wErr) {
|
||||
return io.EOF
|
||||
logging.Logger().Errorf("RPC: %v", wErr)
|
||||
}
|
||||
return wErr
|
||||
return io.EOF
|
||||
}
|
||||
|
||||
return nil
|
||||
|
|
|
@ -3,6 +3,7 @@ package fasthttp
|
|||
import (
|
||||
"io"
|
||||
|
||||
"git.loafle.net/commons_go/logging"
|
||||
"git.loafle.net/commons_go/rpc"
|
||||
"git.loafle.net/commons_go/rpc/protocol"
|
||||
cwf "git.loafle.net/commons_go/websocket_fasthttp"
|
||||
|
@ -23,9 +24,9 @@ func (srwch *ServletReadWriteCloseHandlers) ReadRequest(servletCTX rpc.ServletCo
|
|||
_, buf, err := soc.ReadMessage()
|
||||
if nil != err {
|
||||
if websocket.IsUnexpectedCloseError(err) {
|
||||
return nil, io.EOF
|
||||
logging.Logger().Errorf("RPC: %v", err)
|
||||
}
|
||||
return nil, err
|
||||
return nil, io.EOF
|
||||
}
|
||||
|
||||
return codec.NewRequest(buf)
|
||||
|
@ -54,9 +55,9 @@ func (srwch *ServletReadWriteCloseHandlers) WriteResponse(servletCTX rpc.Servlet
|
|||
wErr = soc.WriteMessage(websocket.TextMessage, buf)
|
||||
if nil != wErr {
|
||||
if websocket.IsUnexpectedCloseError(wErr) {
|
||||
return io.EOF
|
||||
logging.Logger().Errorf("RPC: %v", wErr)
|
||||
}
|
||||
return wErr
|
||||
return io.EOF
|
||||
}
|
||||
|
||||
return nil
|
||||
|
@ -77,9 +78,9 @@ func (srwch *ServletReadWriteCloseHandlers) WriteNotification(servletCTX rpc.Ser
|
|||
wErr = soc.WriteMessage(websocket.TextMessage, buf)
|
||||
if nil != wErr {
|
||||
if websocket.IsUnexpectedCloseError(wErr) {
|
||||
return io.EOF
|
||||
logging.Logger().Errorf("RPC: %v", wErr)
|
||||
}
|
||||
return wErr
|
||||
return io.EOF
|
||||
}
|
||||
|
||||
return nil
|
||||
|
|
Loading…
Reference in New Issue
Block a user