diff --git a/server/server.go b/server/server.go index 83e8fc6..344988a 100644 --- a/server/server.go +++ b/server/server.go @@ -8,21 +8,27 @@ import ( "git.loafle.net/overflow/overflow_gateway_websocket/config" ) -func New(sh ServerHandler) cwf.Server { +func New(sh ServerHandler) Server { if nil == config.Config.Server { logging.Logger().Panic(fmt.Sprintf("Gateway Websocket: Config of server is not initialized")) } - sh.Name = config.Config.Server.Name - sh.Concurrency = config.Config.Server.Concurrency - sh.MaxStopWaitTime = config.Config.Server.MaxStopWaitTime + shs := sh.(*ServerHandlers) - sh.HandshakeTimeout = config.Config.Websocket.HandshakeTimeout - sh.ReadBufferSize = config.Config.Websocket.ReadBufferSize - sh.WriteBufferSize = config.Config.Websocket.WriteBufferSize - sh.EnableCompression = config.Config.Websocket.EnableCompression + shs.Name = config.Config.Server.Name + shs.Concurrency = config.Config.Server.Concurrency + shs.MaxStopWaitTime = config.Config.Server.MaxStopWaitTime - s := cwf.New(sh) + shs.HandshakeTimeout = config.Config.Websocket.HandshakeTimeout + shs.ReadBufferSize = config.Config.Websocket.ReadBufferSize + shs.WriteBufferSize = config.Config.Websocket.WriteBufferSize + shs.EnableCompression = config.Config.Websocket.EnableCompression + + s := cwf.New(shs) return s } + +type Server interface { + cwf.Server +}