IRC.Quit() now waits for RPL_WELCOME and then does a blocking write in a goroutine

This commit is contained in:
khlieng 2015-01-30 00:50:03 +01:00
parent 3c02b00303
commit e715b1c2c0

7
irc.go
View File

@ -162,8 +162,11 @@ func (i *IRC) Whois(nick string) {
}
func (i *IRC) Quit() {
i.Write("QUIT")
i.conn.Close()
go func() {
i.ready.Wait()
i.write("QUIT")
i.conn.Close()
}()
}
func (i *IRC) Write(data string) {