diff --git a/server/server_handler.go b/server/server_handler.go index b890d07..5ff336d 100644 --- a/server/server_handler.go +++ b/server/server_handler.go @@ -11,6 +11,6 @@ type ServerHandler interface { cwf.ServerHandler RegisterServlet(entryPath string, servletHandler servlet.ServletHandler) - RegisterRPCGatewayServlet(entryPath string, rpcGatewayHandler rpc.RPCGatewayHandler) + RegisterRPCGatewayServlet(entryPath string, rpcGatewayHandler rpc.RPCGatewayHandler) servlet.ServletHandler RegisterSubscriber(subscriberHandler oos.SubscriberHandler) } diff --git a/server/server_handlers.go b/server/server_handlers.go index 5873904..ff9c3ed 100644 --- a/server/server_handlers.go +++ b/server/server_handlers.go @@ -88,14 +88,14 @@ func (sh *ServerHandlers) RegisterServlet(entryPath string, servletHandler servl } -func (sh *ServerHandlers) RegisterRPCGatewayServlet(entryPath string, rpcGatewayHandler rpc.RPCGatewayHandler) { +func (sh *ServerHandlers) RegisterRPCGatewayServlet(entryPath string, rpcGatewayHandler rpc.RPCGatewayHandler) servlet.ServletHandler { cfg := config.Config.Servlets[entryPath] if nil == cfg { logging.Logger().Panic(fmt.Sprintf("Gateway Websocket: config of entry path[%s] is not exist", entryPath)) - return + return nil } - rpcSH := oogwisr.NewRPCGatewayServletHandler() + rpcSH := oogwisr.NewRPCGatewayServletHandler(rpcGatewayHandler) rpcSHs := rpcSH.(*oogwisr.RPCGatewayServletHandlers) rpcSHs.MaxMessageSize = cfg.Socket.MaxMessageSize @@ -106,6 +106,8 @@ func (sh *ServerHandlers) RegisterRPCGatewayServlet(entryPath string, rpcGateway rpcSHs.PingPeriod = cfg.Socket.PingPeriod * time.Second sh.RegisterSocketHandler(entryPath, rpcSHs) + + return rpcSH } func (sh *ServerHandlers) RegisterSubscriber(subscriberHandler oos.SubscriberHandler) {