This commit is contained in:
crusader 2018-03-26 23:43:43 +09:00
parent 170438c0d0
commit 22eb6d7703
2 changed files with 12 additions and 11 deletions

View File

@ -32,10 +32,10 @@ func (crwch *ClientReadWriteCloseHandlers) ReadResponse(clientCTX client.ClientC
_, buf, err := soc.ReadMessage() _, buf, err := soc.ReadMessage()
if nil != err { if nil != err {
if websocket.IsUnexpectedCloseError(err) { if !websocket.IsUnexpectedCloseError(err) {
return nil, io.EOF logging.Logger().Errorf("RPC: %v", err)
} }
return nil, err return nil, io.EOF
} }
return codec.NewResponse(buf) return codec.NewResponse(buf)
@ -56,9 +56,9 @@ func (crwch *ClientReadWriteCloseHandlers) WriteRequest(clientCTX client.ClientC
wErr = soc.WriteMessage(websocket.TextMessage, buf) wErr = soc.WriteMessage(websocket.TextMessage, buf)
if nil != wErr { if nil != wErr {
if websocket.IsUnexpectedCloseError(wErr) { if websocket.IsUnexpectedCloseError(wErr) {
return io.EOF logging.Logger().Errorf("RPC: %v", wErr)
} }
return wErr return io.EOF
} }
return nil return nil

View File

@ -3,6 +3,7 @@ package fasthttp
import ( import (
"io" "io"
"git.loafle.net/commons_go/logging"
"git.loafle.net/commons_go/rpc" "git.loafle.net/commons_go/rpc"
"git.loafle.net/commons_go/rpc/protocol" "git.loafle.net/commons_go/rpc/protocol"
cwf "git.loafle.net/commons_go/websocket_fasthttp" cwf "git.loafle.net/commons_go/websocket_fasthttp"
@ -23,9 +24,9 @@ func (srwch *ServletReadWriteCloseHandlers) ReadRequest(servletCTX rpc.ServletCo
_, buf, err := soc.ReadMessage() _, buf, err := soc.ReadMessage()
if nil != err { if nil != err {
if websocket.IsUnexpectedCloseError(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) return codec.NewRequest(buf)
@ -54,9 +55,9 @@ func (srwch *ServletReadWriteCloseHandlers) WriteResponse(servletCTX rpc.Servlet
wErr = soc.WriteMessage(websocket.TextMessage, buf) wErr = soc.WriteMessage(websocket.TextMessage, buf)
if nil != wErr { if nil != wErr {
if websocket.IsUnexpectedCloseError(wErr) { if websocket.IsUnexpectedCloseError(wErr) {
return io.EOF logging.Logger().Errorf("RPC: %v", wErr)
} }
return wErr return io.EOF
} }
return nil return nil
@ -77,9 +78,9 @@ func (srwch *ServletReadWriteCloseHandlers) WriteNotification(servletCTX rpc.Ser
wErr = soc.WriteMessage(websocket.TextMessage, buf) wErr = soc.WriteMessage(websocket.TextMessage, buf)
if nil != wErr { if nil != wErr {
if websocket.IsUnexpectedCloseError(wErr) { if websocket.IsUnexpectedCloseError(wErr) {
return io.EOF logging.Logger().Errorf("RPC: %v", wErr)
} }
return wErr return io.EOF
} }
return nil return nil