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:
lye
2012-03-21 23:08:21 -05:00
parent b06c2dfa4a
commit f2faa10846
2 changed files with 21 additions and 15 deletions

View File

@@ -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