From cf1db90381c937338f5a0e8e567af05a53baf1ea Mon Sep 17 00:00:00 2001 From: siddontang Date: Thu, 18 Jun 2015 16:23:56 +0800 Subject: [PATCH] fix shutdown, windows has no kill function --- server/client_resp.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/server/client_resp.go b/server/client_resp.go index 3145875..55e0db5 100644 --- a/server/client_resp.go +++ b/server/client_resp.go @@ -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 }