Skip to content

Commit

Permalink
修复删除client时server卡死
Browse files Browse the repository at this point in the history
  • Loading branch information
iwannay committed Jul 31, 2018
1 parent b339659 commit 5b9f922
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions libs/rpc/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ func Dial(options ClientOptions) (c *Client) {
c = &Client{}
c.options = options
c.dial()
c.quit = make(chan struct{}, 100)
return c
}

Expand Down Expand Up @@ -97,6 +98,7 @@ func (c *Client) Ping(serviceMethod string) {
time.Sleep(pingDuration)
}
closed:
log.Println("rpc quited", c.options.Addr)
if c.Client != nil {
c.Client.Close()
}
Expand Down

0 comments on commit 5b9f922

Please sign in to comment.