Send a message with a different object to each server. Sockets can either be in an "active" or "non-active" state. This method activates all the sockets through which the client is connected to the workers, and deactivates them when a message is sent to the corresponding worker. This way the sockets pertaining to workers who have been left idle will be the only ones in the active list (TSocket::GetMonitor()->GetListOfActives()) after execution. \param code the code of the message to send (e.g. EMPCode) \param args \parblock a vector containing the different messages to be sent. If the size of the vector is smaller than the number of workers, a message will be sent only to the first args.size() workers. If the size of the args vector is bigger than the number of workers, only the first fNWorkers arguments will be sent. \endparblock \return the number of messages successfully sent
~TMPClient() | |
unsigned int | Broadcast(unsigned int code, unsigned int nMessages = 0) |
unsigned int | Broadcast<std::vector<unsigned int, std::allocator<unsigned int> > >(unsigned int code, vector<unsigned int> obj, unsigned int nMessages = 0) |
unsigned int | Broadcast<unsigned int>(unsigned int code, const vector<unsigned int>& args) |
unsigned int | Broadcast<unsigned int>(unsigned int code, unsigned int obj, unsigned int nMessages = 0) |
void | DeActivate(TSocket* s) |
bool | Fork(TMPWorker& server) |
bool | GetIsParent() const |
TMonitor& | GetMonitor() |
unsigned int | GetNWorkers() const |
void | HandleMPCode(MPCodeBufPair& msg, TSocket* sender) |
TMPClient& | operator=(const TMPClient&) |
void | ReapWorkers() |
void | Remove(TSocket* s) |
void | SetNWorkers(unsigned int n) |
TMPClient(unsigned int nWorkers = 0) | |
TMPClient(const TMPClient&) |
bool | fIsParent | This is true if this is the parent/client process, false if this is a child/worker process |
TMonitor | fMon | This object manages the sockets and detect socket events via TMonitor::Select |
unsigned int | fNWorkers | The number of workers that should be spawned upon forking |
vector<pid_t> | fWorkerPids | A vector containing the PIDs of children processes/workers |
Inheritance Chart: | |||||||||
|
Set the number of workers that will be spawned by the next call to Fork()
{ return fIsParent; }