From d2f3b8c50869ffaf6754c309b9089ba870b4ee2e Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Sat, 2 Apr 2011 23:03:33 +0200 Subject: [PATCH] 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 --- Client.cpp | 2 +- IRCSock.cpp | 2 +- User.cpp | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Client.cpp b/Client.cpp index 6c49b01d..57092ba9 100644 --- a/Client.cpp +++ b/Client.cpp @@ -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()); diff --git a/IRCSock.cpp b/IRCSock.cpp index ccdc4cc7..a4fdddc6 100644 --- a/IRCSock.cpp +++ b/IRCSock.cpp @@ -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; diff --git a/User.cpp b/User.cpp index 97c1edbc..9e39e04b 100644 --- a/User.cpp +++ b/User.cpp @@ -29,14 +29,14 @@ protected: vector& 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"); } }