From 32361ec6f4aaab640e72b45b8219937469c7cd67 Mon Sep 17 00:00:00 2001 From: crusader Date: Fri, 23 Mar 2018 19:58:35 +0900 Subject: [PATCH] ing --- client/rwc/websocket/fasthttp/client_rwc_handlers.go | 6 ++++++ server/rwc/websocket/fasthttp/servlet_rwc_handlers.go | 9 +++++++++ 2 files changed, 15 insertions(+) diff --git a/client/rwc/websocket/fasthttp/client_rwc_handlers.go b/client/rwc/websocket/fasthttp/client_rwc_handlers.go index a0f6d93..5f4bc3d 100644 --- a/client/rwc/websocket/fasthttp/client_rwc_handlers.go +++ b/client/rwc/websocket/fasthttp/client_rwc_handlers.go @@ -32,6 +32,9 @@ func (crwch *ClientReadWriteCloseHandlers) ReadResponse(clientCTX client.ClientC _, r, err := soc.NextReader() if nil != err { + if websocket.IsUnexpectedCloseError(err) { + return nil, io.EOF + } return nil, err } @@ -47,6 +50,9 @@ func (crwch *ClientReadWriteCloseHandlers) WriteRequest(clientCTX client.ClientC wc, wErr = soc.NextWriter(websocket.TextMessage) if nil != wErr { + if websocket.IsUnexpectedCloseError(wErr) { + return io.EOF + } return wErr } defer func() { diff --git a/server/rwc/websocket/fasthttp/servlet_rwc_handlers.go b/server/rwc/websocket/fasthttp/servlet_rwc_handlers.go index 1599bac..fe2b1ab 100644 --- a/server/rwc/websocket/fasthttp/servlet_rwc_handlers.go +++ b/server/rwc/websocket/fasthttp/servlet_rwc_handlers.go @@ -22,6 +22,9 @@ func (srwch *ServletReadWriteCloseHandlers) ReadRequest(servletCTX rpc.ServletCo _, r, err := soc.NextReader() if nil != err { + if websocket.IsUnexpectedCloseError(err) { + return nil, io.EOF + } return nil, err } @@ -37,6 +40,9 @@ func (srwch *ServletReadWriteCloseHandlers) WriteResponse(servletCTX rpc.Servlet wc, wErr = soc.NextWriter(websocket.TextMessage) if nil != wErr { + if websocket.IsUnexpectedCloseError(wErr) { + return io.EOF + } return wErr } @@ -62,6 +68,9 @@ func (srwch *ServletReadWriteCloseHandlers) WriteNotification(servletCTX rpc.Ser wc, wErr = soc.NextWriter(websocket.TextMessage) if nil != wErr { + if websocket.IsUnexpectedCloseError(wErr) { + return io.EOF + } return wErr }