Skip to content
This repository has been archived by the owner on Nov 26, 2018. It is now read-only.

Commit

Permalink
refs #15. give a grace period of 3 missed reply to Ping.
Browse files Browse the repository at this point in the history
  • Loading branch information
yml committed May 18, 2014
1 parent b9f1f88 commit 0bc1136
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions network/irc/irc.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ func (bot *ircBot) monitor() {
for bot.IsRunning() {
if pongCounter > maxPongWithoutMessage {
glog.Infoln("More than maxPongWithoutMessage pong without message for", bot)
glog.Infoln("IRC monitoring KO", bot)

This comment has been minimized.

Copy link
@ipmb

ipmb May 19, 2014

Member

What does KO mean?

bot.reconnect()
}
select {
Expand All @@ -121,8 +122,9 @@ func (bot *ircBot) monitor() {
}
case <-time.After(time.Second * 10):
glog.Infoln("No pong from ircBot server", bot)
glog.Infoln("IRC monitoring KO.")
bot.reconnect()
// Do not kill the server on the first missed PONG
// 3 chances 15/5
pongCounter += 5
}
}
}
Expand Down

1 comment on commit 0bc1136

@yml
Copy link
Member Author

@yml yml commented on 0bc1136 May 19, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.