Refactor reader/writer/pinger
The old code relied on a global bool for reconnect synchronization; this would cause the reader/writer to stop (and not restart) on every other `IRCConnection` when one was `Reconnect`d. This patch renames the methods to indicate they loop, makes them methods on `IRCConnection`, and uses a member of `IRCConnection` for synchronization rather than a global.
This commit is contained in:
@@ -19,6 +19,8 @@ type IRCConnection struct {
|
||||
socket net.Conn
|
||||
pread, pwrite chan string
|
||||
syncreader, syncwriter chan bool
|
||||
reconnecting bool
|
||||
|
||||
nick string //The nickname we want.
|
||||
nickcurrent string //The nickname we currently have.
|
||||
user string
|
||||
|
||||
Reference in New Issue
Block a user