commit
988aaaacd9
8
irc.go
8
irc.go
@ -345,6 +345,9 @@ func (irc *Connection) Disconnect() {
|
|||||||
if irc.end != nil {
|
if irc.end != nil {
|
||||||
close(irc.end)
|
close(irc.end)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
irc.end = nil
|
||||||
|
|
||||||
if irc.pwrite != nil {
|
if irc.pwrite != nil {
|
||||||
close(irc.pwrite)
|
close(irc.pwrite)
|
||||||
}
|
}
|
||||||
@ -359,7 +362,12 @@ func (irc *Connection) Disconnect() {
|
|||||||
|
|
||||||
// Reconnect to a server using the current connection.
|
// Reconnect to a server using the current connection.
|
||||||
func (irc *Connection) Reconnect() error {
|
func (irc *Connection) Reconnect() error {
|
||||||
|
if irc.end != nil {
|
||||||
close(irc.end)
|
close(irc.end)
|
||||||
|
}
|
||||||
|
|
||||||
|
irc.end = nil
|
||||||
|
|
||||||
irc.Wait() //make sure that wait group is cleared ensuring that all spawned goroutines have completed
|
irc.Wait() //make sure that wait group is cleared ensuring that all spawned goroutines have completed
|
||||||
|
|
||||||
irc.end = make(chan struct{})
|
irc.end = make(chan struct{})
|
||||||
|
Loading…
Reference in New Issue
Block a user