overflow_gateway_probe/main.go

44 lines
717 B
Go
Raw Normal View History

2017-11-23 10:33:19 +00:00
package main
import (
2018-03-16 03:17:14 +00:00
"fmt"
"log"
2017-11-23 10:33:19 +00:00
"os"
"os/signal"
"syscall"
2018-03-16 03:17:14 +00:00
"git.loafle.net/commons_go/logging"
2017-11-23 10:33:19 +00:00
"git.loafle.net/overflow/overflow_gateway_probe/server"
"git.loafle.net/overflow/overflow_gateway_probe/servlet"
2018-03-16 03:17:14 +00:00
oogws "git.loafle.net/overflow/overflow_gateway_websocket/server"
2017-11-23 10:33:19 +00:00
)
2018-03-16 03:17:14 +00:00
func main() {
2017-11-23 10:33:19 +00:00
defer logging.Logger().Sync()
sh := server.NewServerHandler()
servlet.ServletInit(sh)
s := oogws.New(sh)
stop := make(chan os.Signal)
signal.Notify(stop, syscall.SIGINT)
go func() {
if err := s.Start(); nil != err {
log.Printf("Server: Start error %v", err)
return
}
}()
select {
case signal := <-stop:
fmt.Printf("Got signal: %v\n", signal)
}
servlet.ServletDestroy()
s.Stop()
}