41 lines
787 B
Go
41 lines
787 B
Go
package server
|
|
|
|
|
|
import (
|
|
csgw "git.loafle.net/commons/server-go/socket/web"
|
|
"git.loafle.net/commons/server-go"
|
|
"net"
|
|
ogeg "git.loafle.net/overflow/gateway/external/grpc"
|
|
)
|
|
|
|
type ServerHandler interface {
|
|
csgw.ServerHandler
|
|
}
|
|
|
|
type ServerHandlers struct {
|
|
csgw.ServerHandlers
|
|
}
|
|
|
|
func (sh *ServerHandlers) Init(serverCtx server.ServerCtx) error {
|
|
if err := sh.ServerHandlers.Init(serverCtx); nil != err {
|
|
return nil
|
|
}
|
|
ogeg.InitPackage()
|
|
|
|
return nil
|
|
}
|
|
|
|
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
|
|
}
|
|
|
|
func (sh *ServerHandlers) Destroy(serverCtx server.ServerCtx) {
|
|
ogeg.DestroyPackage()
|
|
|
|
sh.ServerHandlers.Destroy(serverCtx)
|
|
} |