45 lines
719 B
Go
45 lines
719 B
Go
package main
|
|
|
|
import (
|
|
"git.loafle.net/commons_go/logging"
|
|
"os"
|
|
"os/signal"
|
|
"syscall"
|
|
"log"
|
|
"fmt"
|
|
"git.loafle.net/overflow/overflow_gateway_probe/server"
|
|
oogws "git.loafle.net/overflow/overflow_gateway_websocket/server"
|
|
"git.loafle.net/overflow/overflow_gateway_probe/servlet"
|
|
)
|
|
|
|
|
|
func main() {
|
|
|
|
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()
|
|
}
|
|
|