forked from External/ergo
don't allow send on closed channels
This commit is contained in:
parent
ca25828804
commit
7a2c9db503
3 changed files with 17 additions and 1 deletions
|
|
@ -161,6 +161,7 @@ func (client *Client) Destroy() {
|
|||
client.conn.Close()
|
||||
|
||||
close(client.replies)
|
||||
client.replies = nil
|
||||
|
||||
if client.idleTimer != nil {
|
||||
client.idleTimer.Stop()
|
||||
|
|
@ -177,6 +178,9 @@ func (client *Client) Destroy() {
|
|||
}
|
||||
|
||||
func (client *Client) Reply(replies ...Reply) {
|
||||
if client.replies == nil {
|
||||
return
|
||||
}
|
||||
for _, reply := range replies {
|
||||
client.replies <- reply
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue