diff --git a/server/rwc/websocket/fasthttp/servlet_rwc_handlers.go b/server/rwc/websocket/fasthttp/servlet_rwc_handlers.go index 77f8900..99767ee 100644 --- a/server/rwc/websocket/fasthttp/servlet_rwc_handlers.go +++ b/server/rwc/websocket/fasthttp/servlet_rwc_handlers.go @@ -57,6 +57,10 @@ func (srwch *ServletReadWriteCloseHandlers) WriteNotification(servletCTX rpc.Ser return wErr } + defer func() { + wc.Close() + }() + if wErr := codec.WriteNotification(wc, method, params); nil != wErr { return wErr } diff --git a/server/servlet_handlers.go b/server/servlet_handlers.go index 7696a46..61b9299 100644 --- a/server/servlet_handlers.go +++ b/server/servlet_handlers.go @@ -1,8 +1,6 @@ package server import ( - "fmt" - "git.loafle.net/commons_go/logging" "git.loafle.net/commons_go/rpc" "git.loafle.net/commons_go/rpc/protocol" @@ -16,18 +14,19 @@ type ServletHandlers struct { } func (sh *ServletHandlers) Invoke(servletCTX rpc.ServletContext, requestCodec protocol.RegistryCodec) (result interface{}, err error) { - if !sh.RPCInvoker.HasMethod(requestCodec.Method()) { - return nil, fmt.Errorf("RPC Servlet Handler: Method[%s] is not exist", requestCodec.Method()) - } + // if !sh.RPCInvoker.HasMethod(requestCodec.Method()) { + // return nil, fmt.Errorf("RPC Servlet Handler: Method[%s] is not exist", requestCodec.Method()) + // } result, err = sh.RPCInvoker.Invoke(requestCodec) - if nil != err { - if params, pErr := requestCodec.Params(); nil != err { - logging.Logger().Errorf("RPC Servlet Handler: Read Param of Method[%s] returns error %v", requestCodec.Method(), pErr) - } else { - logging.Logger().Errorf("RPC Servlet Handler: Method[%s] params[%v] returns error %v", requestCodec.Method(), params, err) - } - } + + // if nil != err { + // params, pErr := requestCodec.Params() + // if nil != pErr { + // logging.Logger().Errorf("RPC Servlet Handler: Read Param of Method[%s] returns error %v", requestCodec.Method(), pErr) + // } + // logging.Logger().Errorf("RPC Servlet Handler: Method[%s] params[%v] returns error %v", requestCodec.Method(), params, err) + // } return }