From f3ea7a8fedbaf982ff7b6d5da66d5f56ff913495 Mon Sep 17 00:00:00 2001 From: crusader Date: Tue, 14 Nov 2017 16:37:00 +0900 Subject: [PATCH] ing --- server/server_handler.go | 2 +- server/server_handlers.go | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) 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) {