diff --git a/servlet/rpc-servlet.go b/servlet/rpc-servlet.go index 64b4184..9dee116 100644 --- a/servlet/rpc-servlet.go +++ b/servlet/rpc-servlet.go @@ -6,7 +6,6 @@ import ( logging "git.loafle.net/commons/logging-go" crp "git.loafle.net/commons/rpc-go/protocol" - crpj "git.loafle.net/commons/rpc-go/protocol/json" "git.loafle.net/commons/server-go" css "git.loafle.net/commons/server-go/socket" cssw "git.loafle.net/commons/server-go/socket/web" @@ -23,7 +22,8 @@ type RPCServlet interface { type RPCServlets struct { cssw.Servlets - UseSession bool + RPCServerCodec crp.ServerCodec + UseSession bool sessions sync.Map } @@ -72,7 +72,6 @@ func (s *RPCServlets) Handle(servletCtx server.ServletCtx, replyBuff []byte err error ) - sc := crpj.NewServerCodec() _clientType := servletCtx.GetAttribute(og.SessionClientTypeKey) _sessionID := servletCtx.GetAttribute(og.SessionIDKey) @@ -95,7 +94,7 @@ func (s *RPCServlets) Handle(servletCtx server.ServletCtx, return } // grpc exec method call - src, err = sc.NewRequest(msg) + src, err = s.RPCServerCodec.NewRequest(msg) if nil != err { logging.Logger().Error(err) break