This commit is contained in:
crusader 2017-12-01 17:12:09 +09:00
parent 51bbdb4429
commit 9c0a3b06a5
3 changed files with 10 additions and 10 deletions

View File

@ -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

View File

@ -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()
}

View File

@ -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
}