Vault  4.1
Public Member Functions | Friends
VSocketConnectionStrategyThreadedRunner Class Reference

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...

Inheritance diagram for VSocketConnectionStrategyThreadedRunner:
VThread

List of all members.

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

Detailed Description

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.


Member Function Documentation

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().


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

Copyright ©1997-2014 Trygve Isaacson. All rights reserved. This documentation was generated with Doxygen.