The InspIRCd Project
Home | Developers | Wiki | Forums | Bug Tracker | SVN | Download | Blog | Stats
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

RequestTimeout Class Reference

Inheritance diagram for RequestTimeout:

Inheritance graph
[legend]
Collaboration diagram for RequestTimeout:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 RequestTimeout (unsigned long n, InspIRCd *SI, DNSRequest *watching, int id)
void Tick (time_t TIME)
 Called when the timer ticks.

Private Attributes

InspIRCdServerInstance
DNSRequestwatch
int watchid

Detailed Description

Definition at line 126 of file dns.cpp.


Constructor & Destructor Documentation

RequestTimeout::RequestTimeout unsigned long  n,
InspIRCd SI,
DNSRequest watching,
int  id
[inline]
 

Definition at line 132 of file dns.cpp.

00132                                                                                     : InspTimer(n, time(NULL)), ServerInstance(SI), watch(watching), watchid(id)
00133         {
00134         }


Member Function Documentation

void RequestTimeout::Tick time_t  TIME  )  [inline, virtual]
 

Called when the timer ticks.

You should override this method with some useful code to handle the tick event.

Implements InspTimer.

Definition at line 136 of file dns.cpp.

References DNS::Classes, DELETE(), Resolver::OnError(), DNS::requests, InspIRCd::Res, RESOLVER_TIMEOUT, ServerInstance, watch, and watchid.

00137         {
00138                 if (ServerInstance->Res->requests[watchid] == watch)
00139                 {
00140                         /* Still exists, whack it */
00141                         if (ServerInstance->Res->Classes[watchid])
00142                         {
00143                                 ServerInstance->Res->Classes[watchid]->OnError(RESOLVER_TIMEOUT, "Request timed out");
00144                                 delete ServerInstance->Res->Classes[watchid];
00145                                 ServerInstance->Res->Classes[watchid] = NULL;
00146                         }
00147                         ServerInstance->Res->requests[watchid] = NULL;
00148                         DELETE(watch);
00149                         return;
00150                 }
00151         }


Member Data Documentation

InspIRCd* RequestTimeout::ServerInstance [private]
 

Definition at line 128 of file dns.cpp.

Referenced by Tick().

DNSRequest* RequestTimeout::watch [private]
 

Definition at line 129 of file dns.cpp.

Referenced by Tick().

int RequestTimeout::watchid [private]
 

Definition at line 130 of file dns.cpp.

Referenced by Tick().


The documentation for this class was generated from the following file: