This commit is contained in:
crusader 2017-11-14 15:02:42 +09:00
parent 8c19c1a887
commit e5a491c6bb

View File

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