This commit is contained in:
crusader 2018-05-08 19:09:47 +09:00
parent 8fb9ee1301
commit 8b1daa22ff

View File

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