overflow_gateway_webapp/main.go

42 lines
692 B
Go
Raw Normal View History

2017-11-13 16:50:37 +00:00
package main
2017-11-14 03:45:48 +00:00
import (
"fmt"
"log"
"os"
"os/signal"
"syscall"
"git.loafle.net/commons_go/logging"
"git.loafle.net/overflow/overflow_gateway_webapp/server"
2017-11-28 11:08:46 +00:00
"git.loafle.net/overflow/overflow_gateway_webapp/servlet"
2017-11-14 03:45:48 +00:00
oogws "git.loafle.net/overflow/overflow_gateway_websocket/server"
)
2017-11-13 16:50:37 +00:00
func main() {
2017-11-14 03:45:48 +00:00
defer logging.Logger().Sync()
2017-11-28 11:08:46 +00:00
sh := server.NewServerHandler()
servlet.ServletInit(sh)
s := oogws.New(sh)
2017-11-14 03:45:48 +00:00
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)
}
s.Stop()
2017-11-13 16:50:37 +00:00
}