ing
This commit is contained in:
parent
8c19c1a887
commit
e5a491c6bb
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user