Change the way the pinger works.

Fix syning threads before reconnections
Formatting
This commit is contained in:
Thomas Jager
2012-11-07 21:51:24 +01:00
parent d53de8bdbd
commit c8f78ebf45
3 changed files with 37 additions and 29 deletions

View File

@@ -20,8 +20,8 @@ type Connection struct {
socket net.Conn
pread, pwrite chan string
syncreader, syncwriter chan bool
reconnecting bool
syncreader, syncwriter, syncpinger chan bool
endping chan bool
nick string //The nickname we want.
nickcurrent string //The nickname we currently have.
@@ -30,9 +30,8 @@ type Connection struct {
server string
events map[string][]func(*Event)
lastMessage time.Time
ticker <-chan time.Time
ticker2 <-chan time.Time
lastMessage time.Time
ticker, ticker2 *time.Ticker
VerboseCallbackHandler bool
log *log.Logger