Improve IRC connection handling
This commit is contained in:
parent
6f9f3cff95
commit
c22b7d2a1d
6 changed files with 311 additions and 14 deletions
|
@ -31,6 +31,7 @@ type Client struct {
|
|||
quit chan struct{}
|
||||
reconnect chan struct{}
|
||||
ready sync.WaitGroup
|
||||
sendRecv sync.WaitGroup
|
||||
once resync.Once
|
||||
lock sync.Mutex
|
||||
}
|
||||
|
@ -83,11 +84,6 @@ func (c *Client) Quit() {
|
|||
c.write("QUIT")
|
||||
}
|
||||
close(c.quit)
|
||||
c.lock.Lock()
|
||||
if c.conn != nil {
|
||||
c.conn.Close()
|
||||
}
|
||||
c.lock.Unlock()
|
||||
}()
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue