![]() |
Vault
4.1
|
Because the strategy involves creating multiple threads but wanting to proceed as soon as 1 of them succeeds, we need an intermediary thread object that can live longer and wait around for all of the workers to complete and properly bookkeep them. More...
Public Member Functions | |
VSocketConnectionStrategyThreadedRunner (const VDuration &timeoutInterval, int maxNumThreads, const VString &hostName, int portNumber, const VStringVector &debugIPAddresses) | |
virtual void | run () |
Override required in each VThread subclass, run() does whatever the thread is designed to do, and returns when the thread has completed its task or detects that isRunning() returns false. | |
bool | hasAnswer () const |
VSocketID | getConnectedSockID () const |
VString | getConnectedIPAddress () const |
void | detachFromStrategy () |
Friends | |
class | VSocketConnectionStrategyThreadedWorker |
Because the strategy involves creating multiple threads but wanting to proceed as soon as 1 of them succeeds, we need an intermediary thread object that can live longer and wait around for all of the workers to complete and properly bookkeep them.
This "runner" class manages all communication with the workers, pokes the strategy object back immediately upon success (at which point the strategy can let go of the runner and proceed), and hangs around until all worker threads have communicated their completion.
Definition at line 730 of file vsocket.cpp.
void VSocketConnectionStrategyThreadedRunner::run | ( | ) | [virtual] |
Override required in each VThread subclass, run() does whatever the thread is designed to do, and returns when the thread has completed its task or detects that isRunning() returns false.
If the thread is designed to be stoppable from another thread, then its run() method must check the isRunning() property periodically and return when the property becomes false.
Implements VThread.
Definition at line 853 of file vsocket.cpp.
References VDuration::MILLISECOND(), VSocket::resolveHostName(), and VThread::sleep().