some more check on http sockets
This commit is contained in:
parent
647701822c
commit
917e457af0
1 changed files with 13 additions and 6 deletions
|
@ -63,21 +63,28 @@ func main() {
|
|||
unixListener, err := net.Listen("unix", *querySocket)
|
||||
if err != nil {
|
||||
fmt.Fprintln(os.Stderr, "Error binding HTTP unix domain socket", err)
|
||||
return
|
||||
}
|
||||
go http.Serve(unixListener, nil)
|
||||
go func() {
|
||||
err := http.Serve(unixListener, nil)
|
||||
if err != nil {
|
||||
fmt.Fprintln(os.Stderr, "error binding:", err)
|
||||
}
|
||||
}()
|
||||
} else {
|
||||
fmt.Printf("Binding address `%s` [http]\n", *queryAddr)
|
||||
go http.ListenAndServe(*queryAddr, nil)
|
||||
go func() {
|
||||
err := http.ListenAndServe(*queryAddr, nil)
|
||||
if err != nil {
|
||||
fmt.Fprintln(os.Stderr, "error binding:", err)
|
||||
}
|
||||
}()
|
||||
}
|
||||
|
||||
for {
|
||||
select {
|
||||
case <-interrupt:
|
||||
server.Kill()
|
||||
//server.Wait()
|
||||
if *syslogSocketPath != "" {
|
||||
|
||||
}
|
||||
return
|
||||
default:
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue