This commit is contained in:
crusader 2017-11-14 16:37:00 +09:00
parent 38f2405ff3
commit f3ea7a8fed
2 changed files with 6 additions and 4 deletions

View File

@ -11,6 +11,6 @@ type ServerHandler interface {
cwf.ServerHandler cwf.ServerHandler
RegisterServlet(entryPath string, servletHandler servlet.ServletHandler) RegisterServlet(entryPath string, servletHandler servlet.ServletHandler)
RegisterRPCGatewayServlet(entryPath string, rpcGatewayHandler rpc.RPCGatewayHandler) RegisterRPCGatewayServlet(entryPath string, rpcGatewayHandler rpc.RPCGatewayHandler) servlet.ServletHandler
RegisterSubscriber(subscriberHandler oos.SubscriberHandler) RegisterSubscriber(subscriberHandler oos.SubscriberHandler)
} }

View File

@ -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] cfg := config.Config.Servlets[entryPath]
if nil == cfg { if nil == cfg {
logging.Logger().Panic(fmt.Sprintf("Gateway Websocket: config of entry path[%s] is not exist", entryPath)) 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 := rpcSH.(*oogwisr.RPCGatewayServletHandlers)
rpcSHs.MaxMessageSize = cfg.Socket.MaxMessageSize rpcSHs.MaxMessageSize = cfg.Socket.MaxMessageSize
@ -106,6 +106,8 @@ func (sh *ServerHandlers) RegisterRPCGatewayServlet(entryPath string, rpcGateway
rpcSHs.PingPeriod = cfg.Socket.PingPeriod * time.Second rpcSHs.PingPeriod = cfg.Socket.PingPeriod * time.Second
sh.RegisterSocketHandler(entryPath, rpcSHs) sh.RegisterSocketHandler(entryPath, rpcSHs)
return rpcSH
} }
func (sh *ServerHandlers) RegisterSubscriber(subscriberHandler oos.SubscriberHandler) { func (sh *ServerHandlers) RegisterSubscriber(subscriberHandler oos.SubscriberHandler) {