diff --git a/internal/server/rpc/rpc_gateway_servlet_handlers.go b/internal/server/rpc/rpc_gateway_servlet_handlers.go index 92a97fc..dc59d12 100644 --- a/internal/server/rpc/rpc_gateway_servlet_handlers.go +++ b/internal/server/rpc/rpc_gateway_servlet_handlers.go @@ -35,6 +35,12 @@ type RPCGatewayServletHandlers struct { gwRPCHandler rpc.GatewayRPCHandler } +func (sh *RPCGatewayServletHandlers) SocketContext(serverCTX cwf.ServerContext) cwf.SocketContext { + socketCTX := sh.ServletHandlers.SocketContext(serverCTX) + + return newServletContext(socketCTX) +} + func (sh *RPCGatewayServletHandlers) Init(serverCTX cwf.ServerContext) error { if err := sh.ServletHandlers.Init(serverCTX); nil != err { return err @@ -47,14 +53,8 @@ func (sh *RPCGatewayServletHandlers) Init(serverCTX cwf.ServerContext) error { return nil } -func (sh *RPCGatewayServletHandlers) Handshake(serverCTX cwf.ServerContext, ctx *fasthttp.RequestCtx) (id string, extensionsHeader *fasthttp.ResponseHeader) { - return sh.gwRPCHandler.Handshake(serverCTX, ctx) -} - -func (sh *RPCGatewayServletHandlers) SocketContext(serverCTX cwf.ServerContext) cwf.SocketContext { - socketCTX := sh.ServletHandlers.SocketContext(serverCTX) - - return newServletContext(socketCTX) +func (sh *RPCGatewayServletHandlers) Handshake(socketCTX cwf.SocketContext, ctx *fasthttp.RequestCtx) (id string, extensionsHeader *fasthttp.ResponseHeader) { + return sh.gwRPCHandler.Handshake(socketCTX, ctx) } // OnConnect invoked when client is connected diff --git a/rpc/gateway_rpc_handler.go b/rpc/gateway_rpc_handler.go index fd18bf4..ac3cd3e 100644 --- a/rpc/gateway_rpc_handler.go +++ b/rpc/gateway_rpc_handler.go @@ -8,7 +8,7 @@ import ( type GatewayRPCHandler interface { Init(serverCTX cwf.ServerContext) error - Handshake(serverCTX cwf.ServerContext, ctx *fasthttp.RequestCtx) (id string, extensionsHeader *fasthttp.ResponseHeader) + Handshake(socketCTX cwf.SocketContext, ctx *fasthttp.RequestCtx) (id string, extensionsHeader *fasthttp.ResponseHeader) Validate() } diff --git a/rpc/gateway_rpc_handlers.go b/rpc/gateway_rpc_handlers.go index 0982051..1c08ce0 100644 --- a/rpc/gateway_rpc_handlers.go +++ b/rpc/gateway_rpc_handlers.go @@ -12,7 +12,7 @@ func (sh *GatewayRPCHandlers) Init(serverCTX cwf.ServerContext) error { return nil } -func (sh *GatewayRPCHandlers) Handshake(serverCTX cwf.ServerContext, ctx *fasthttp.RequestCtx) (id string, extensionsHeader *fasthttp.ResponseHeader) { +func (sh *GatewayRPCHandlers) Handshake(socketCTX cwf.SocketContext, ctx *fasthttp.RequestCtx) (id string, extensionsHeader *fasthttp.ResponseHeader) { return "", nil }