PingThread Class Reference

A thread class that sends pings to socket. More...

#include <pingthread.h>

Inherits Thread.

Collaboration diagram for PingThread:
Collaboration graph
[legend]

Public Member Functions

 PingThread (iNetClass &parent, unsigned int interval)
void Init ()
ExitCode Wait ()
 overrides wxThread::Wait . Wakes up from sleep if sleeping, to prevent delay.
bool Sleep (int milliseconds)
 returns false when woken up
void WakeUp ()
 call this from outside thread to wake up Sleep - ing thread
bool TestDestroy ()
 overrides wxThread::TestDestroy , which can fail on Wait
wxThreadError Run ()

Protected Attributes

wxSemaphore m_thread_sleep_semaphore
bool m_must_exit
 workaround for old wxWidgets bug

Private Member Functions

void * Entry ()
void OnExit ()

Private Attributes

iNetClassm_parent
unsigned int m_interval

Detailed Description

A thread class that sends pings to socket.

Implemented as joinable thread. When you want it started, construct it then call Init() When you want it killed, call Wait() method. Dont call other methods, especially the Destroy() method.

Definition at line 15 of file pingthread.h.


Constructor & Destructor Documentation

PingThread::PingThread ( iNetClass parent,
unsigned int  interval 
)

Definition at line 6 of file pingthread.cpp.


Member Function Documentation

void * PingThread::Entry (  )  [private]

Definition at line 20 of file pingthread.cpp.

void PingThread::Init (  ) 

Definition at line 12 of file pingthread.cpp.

void PingThread::OnExit (  )  [private]

Definition at line 31 of file pingthread.cpp.

wxThreadError Thread::Run (  )  [inherited]

Definition at line 100 of file thread.cpp.

bool Thread::Sleep ( int  milliseconds  )  [inherited]

returns false when woken up

Definition at line 85 of file thread.cpp.

bool Thread::TestDestroy (  )  [inherited]

overrides wxThread::TestDestroy , which can fail on Wait

Reimplemented in HttpDownloaderThread< ParentClass >, TorrentMaintenanceThread, and HttpDownloaderThread< UpdaterClass >.

Definition at line 105 of file thread.cpp.

Thread::ExitCode Thread::Wait (  )  [inherited]

overrides wxThread::Wait . Wakes up from sleep if sleeping, to prevent delay.

Definition at line 94 of file thread.cpp.

void Thread::WakeUp (  )  [inherited]

call this from outside thread to wake up Sleep - ing thread

Definition at line 90 of file thread.cpp.


Field Documentation

unsigned int PingThread::m_interval [private]

Definition at line 24 of file pingthread.h.

bool Thread::m_must_exit [protected, inherited]

workaround for old wxWidgets bug

Definition at line 60 of file thread.h.

Definition at line 23 of file pingthread.h.

wxSemaphore Thread::m_thread_sleep_semaphore [protected, inherited]

Definition at line 58 of file thread.h.


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

Generated on Thu Dec 29 00:11:47 2011 for SpringLobby by doxygen 1.6.3