ClientMain Class Reference

#include <ClientMain.h>

Collaboration diagram for ClientMain:

Collaboration graph
[legend]
List of all members.

Detailed Description

Definition at line 15 of file ClientMain.h.

Public Member Functions

 ClientMain (string newRemoteAddress, string newRemotePort, string newPollingPeriod, string newNetworkTimeout) throw (const char *)
virtual ~ClientMain ()
int run (string operation, string jobID) throw (const char *)

Static Public Member Functions

static void init ()

Private Member Functions

bool requestService ()
void fulfillService ()
void requestStatus (const int jobId)
void requestHalt (const int jobId)
bool sendAndReceive (const string interface, const Message &request, Message &answer) throw (NetInterfaceException)
void enterCriticalSection ()
void leaveCriticalSection ()
void createWorker ()
void createReminder ()
void workerThread ()
void reminderThread ()
void registerSignalHandler ()
void removeSignalHandler ()
void signalHandler (int sign)

Static Private Member Functions

static void * staticWorkerWrapper (void *ptr)
static void * staticReminderWrapper (void *ptr)
static void staticSignalHandlerWrapper (int sign)
static pthread_mutex_t handledInstancesMutexInit ()
static void lockHandledInstances ()
static void unlockHandledInstances ()
static int handledInstancesPosition (ClientMain *instance)

Private Attributes

string remoteAddress
int remotePort
int pollingPeriod
int networkTimeout
NetInterfacepMainNetInterface
NetInterfacepCallbackNetInterface
pthread_t worker
pthread_t reminder
pthread_mutex_t criticalSection
bool working
bool serviceNeeded
bool allowRequestService
ServiceOfferpServiceOffer

Static Private Attributes

static vector< ClientMain * > handledInstances
static pthread_mutex_t handledInstancesMutex


The documentation for this class was generated from the following files:
Generated on Wed Jun 25 14:47:08 2008 for keyvil by  doxygen 1.5.1