2017-11-09 09:14:57 +00:00
|
|
|
package server
|
|
|
|
|
|
|
|
import (
|
|
|
|
cwf "git.loafle.net/commons_go/websocket_fasthttp"
|
|
|
|
"git.loafle.net/overflow/overflow_gateway_app/servlet/web"
|
|
|
|
)
|
|
|
|
|
|
|
|
func New() cwf.Server {
|
|
|
|
sh := newServerHandler()
|
2017-11-09 11:09:18 +00:00
|
|
|
registerWebServlet(sh)
|
2017-11-09 09:14:57 +00:00
|
|
|
|
|
|
|
s := cwf.New(sh)
|
|
|
|
|
|
|
|
return s
|
|
|
|
}
|
2017-11-09 11:09:18 +00:00
|
|
|
|
|
|
|
func registerWebServlet(sh ServerHandler) {
|
|
|
|
webEntry, wsh := web.NewSocketHandler()
|
|
|
|
wsubh := web.NewSubscriberHandler(webEntry)
|
|
|
|
|
|
|
|
sh.RegisterSocketHandler(webEntry, wsh)
|
|
|
|
sh.RegisterSubscriberHandler(wsubh)
|
|
|
|
|
|
|
|
}
|