A thread class that sends pings to socket. More...
#include <pingthread.h>
Inherits Thread.

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 | |
| iNetClass & | m_parent |
| unsigned int | m_interval |
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.
| PingThread::PingThread | ( | iNetClass & | parent, | |
| unsigned int | interval | |||
| ) |
Definition at line 6 of file pingthread.cpp.
| 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.
unsigned int PingThread::m_interval [private] |
Definition at line 24 of file pingthread.h.
bool Thread::m_must_exit [protected, inherited] |
iNetClass& PingThread::m_parent [private] |
Definition at line 23 of file pingthread.h.
wxSemaphore Thread::m_thread_sleep_semaphore [protected, inherited] |
1.6.3