2018-04-06 11:57:54 +00:00
|
|
|
package server
|
|
|
|
|
|
|
|
|
|
|
|
import (
|
2018-04-06 12:23:53 +00:00
|
|
|
csgw "git.loafle.net/commons/server-go/socket/web"
|
2018-04-06 11:57:54 +00:00
|
|
|
"git.loafle.net/commons/server-go"
|
|
|
|
"net"
|
2018-04-06 12:23:53 +00:00
|
|
|
ogeg "git.loafle.net/overflow/gateway/external/grpc"
|
2018-04-06 11:57:54 +00:00
|
|
|
)
|
|
|
|
|
2018-04-06 12:23:53 +00:00
|
|
|
type ServerHandler interface {
|
|
|
|
csgw.ServerHandler
|
|
|
|
}
|
|
|
|
|
2018-04-06 11:57:54 +00:00
|
|
|
type ServerHandlers struct {
|
2018-04-06 12:23:53 +00:00
|
|
|
csgw.ServerHandlers
|
2018-04-06 11:57:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (sh *ServerHandlers) Init(serverCtx server.ServerCtx) error {
|
2018-04-06 12:23:53 +00:00
|
|
|
if err := sh.ServerHandlers.Init(serverCtx); nil != err {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
ogeg.InitPackage()
|
|
|
|
|
|
|
|
return nil
|
2018-04-06 11:57:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (sh *ServerHandlers) Listener(serverCtx server.ServerCtx) (net.Listener, error) {
|
|
|
|
l, err := net.Listen("tcp", "192.168.1.103:44449")
|
|
|
|
if nil != err {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
return l, nil
|
|
|
|
}
|
2018-04-06 12:23:53 +00:00
|
|
|
|
|
|
|
func (sh *ServerHandlers) Destroy(serverCtx server.ServerCtx) {
|
|
|
|
ogeg.DestroyPackage()
|
|
|
|
|
|
|
|
sh.ServerHandlers.Destroy(serverCtx)
|
|
|
|
}
|