Permalink
Browse files

Raise our IRC connection timeouts

ZNC will now send a PING if the connection was idle for 270 to 300 seconds.
After 540 seconds (that is, about 270 to 240 seconds later) the timeout is
triggered and ZNC reconnects.

These values are "inspired" by the values eggdrop uses.

The old timeouts were 180 to 210 secs for the PING and 240 secs for the timeout.

Signed-off-by: Uli Schlachter <psychon@znc.in>
  • Loading branch information...
1 parent f0bf713 commit d2f3b8c50869ffaf6754c309b9089ba870b4ee2e @psychon psychon committed Apr 2, 2011
Showing with 4 additions and 4 deletions.
  1. +1 −1 Client.cpp
  2. +1 −1 IRCSock.cpp
  3. +2 −2 User.cpp
View
@@ -663,7 +663,7 @@ void CClient::AcceptLogin(CUser& User) {
// Set our proper timeout and set back our proper timeout mode
// (constructor set a different timeout and mode)
- SetTimeout(240, TMO_READ);
+ SetTimeout(540, TMO_READ);
SetSockName("USR::" + m_pUser->GetUserName());
View
@@ -128,7 +128,7 @@ void CIRCSock::ReadLine(const CString& sData) {
}
m_pUser->SetIRCServer(sServer);
- SetTimeout(240, TMO_READ); // Now that we are connected, let nature take its course
+ SetTimeout(540, TMO_READ); // Now that we are connected, let nature take its course
PutIRC("WHO " + sNick);
m_bAuthed = true;
View
@@ -29,14 +29,14 @@ class CUserTimer : public CCron {
vector<CClient*>& vClients = m_pUser->GetClients();
CIRCSock* pIRCSock = m_pUser->GetIRCSock();
- if (pIRCSock && pIRCSock->GetTimeSinceLastDataTransaction() >= 180) {
+ if (pIRCSock && pIRCSock->GetTimeSinceLastDataTransaction() >= 270) {
pIRCSock->PutIRC("PING :ZNC");
}
for (size_t a = 0; a < vClients.size(); a++) {
CClient* pClient = vClients[a];
- if (pClient->GetTimeSinceLastDataTransaction() >= 180) {
+ if (pClient->GetTimeSinceLastDataTransaction() >= 270) {
pClient->PutClient("PING :ZNC");
}
}

0 comments on commit d2f3b8c

Please sign in to comment.