fix shutdown, windows has no kill function

This commit is contained in:
siddontang 2015-06-18 16:23:56 +08:00
parent a298919dd0
commit cf1db90381
1 changed files with 6 additions and 1 deletions

View File

@ -6,6 +6,7 @@ import (
"fmt"
"io"
"net"
"os"
"runtime"
"strconv"
"syscall"
@ -172,7 +173,11 @@ func (c *respClient) handleRequest(reqData [][]byte) error {
c.conn.Close()
// send kill signal
syscall.Kill(syscall.Getpid(), syscall.SIGTERM)
p, _ := os.FindProcess(os.Getpid())
p.Signal(syscall.SIGTERM)
p.Signal(os.Interrupt)
return errClientQuit
}