Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

PostOffice Class Reference

#include <PostOffice.h>

List of all members.

Public Methods

 PostOffice (int port=0, int n=1, int incremental=UDP_PORT_ITERATE, Crypter *crypter=0, int noSecPlain=1, int catchSignal=0)
int initialized ()
 ~PostOffice ()
uint getLocalPort ()
void getLocalPort (uint *ports)
int send (XMLData *data, Address *remote=NULL, secure_method s=sm_plain)
int sendN (XMLData *data, Address *remote=NULL, secure_method s=sm_plain)
send_state checkN (int messageID)
void deleteN (int messageID)
XMLDatareceive (Address *remote=NULL, int timeout=NO_TIMEOUT)
XMLDatareceiveN (Address *remote=NULL)
XMLDatareceive_any (Address &remote, int timeout=NO_TIMEOUT)
XMLDatareceive_anyN (Address &remote)
void setRemote (Address &remote)
void put_back (Address &addr, XMLData *data)
void stopWait (Address &remote)
void purgeIn (Address &remote)
void setCrypter (Crypter *crypter)

Static Public Methods

void init_sockets ()
void release_sockets ()

Static Public Attributes

XMLDataReceiveInterrupted = &recInterrupted
XMLDataTimeout = &timout

Private Methods

void inbox ()
int _send (XMLData *data, Address *remote, int nonblocking, secure_method s=sm_plain)
XMLData_receive (Address *remote, int blocking, int timeout)
XMLData_receive_any (Address &remote, int blocking, int timeout)

Private Attributes

UDPConfirm udp
List queue
List receiveOrder
Semaphore sem
Lock lock
thread_handle recThread
int finish
int localPort
int interrupted
Cryptercrypter
int noSecPlain
int catchSignal
int init_ok

Friends

void * inbox_entry (void *arg)


Constructor & Destructor Documentation

PostOffice::PostOffice int    port = 0,
int    n = 1,
int    incremental = UDP_PORT_ITERATE,
Crypter   crypter = 0,
int    noSecPlain = 1,
int    catchSignal = 0
[inline]
 

Definition at line 188 of file PostOffice.h.

References UDPConfirm::createSocket(), DBUG_PRINT, DEFAULT_POFFICE_PORT, inbox_entry(), startThread(), and UDP_PORT_ITERATE.

PostOffice::~PostOffice   [inline]
 

Definition at line 227 of file PostOffice.h.

References DBUG_PRINT, List::Release(), SLEEP_MSEC, and UDPConfirm::stopWait().


Member Function Documentation

XMLData * PostOffice::_receive Address   remote,
int    blocking,
int    timeout
[private]
 

Definition at line 173 of file PostOffice.cpp.

References List::Add(), ItemSender::addr, List::Count(), ItemDataIn::data, ItemSender::data, DBUG_PRINT, Address::equals(), List::Get_First(), List::Get_Next(), interrupted, ItemSender::lastUsed, Lock::lock(), lock, XMLData::Nil, queue, ReceiveInterrupted, receiveOrder, List::Remove(), sem, ItemSender::sem, SEM_TIMEOUT, SENDER_REMOVE_TIMEOUT, Timeout, Lock::unlock(), Semaphore::value(), and Semaphore::wait().

Referenced by receive(), and receiveN().

XMLData * PostOffice::_receive_any Address   remote,
int    blocking,
int    timeout
[private]
 

Definition at line 293 of file PostOffice.cpp.

References ItemSender::addr, List::Count(), ItemDataIn::data, ItemSender::data, List::Get_First(), List::Get_Next(), interrupted, ItemSender::lastUsed, Lock::lock(), lock, XMLData::Nil, queue, ReceiveInterrupted, receiveOrder, List::Remove(), ItemSender::sem, sem, SEM_TIMEOUT, ItemDataIn::sender, SENDER_REMOVE_TIMEOUT, Timeout, Lock::unlock(), Semaphore::value(), and Semaphore::wait().

Referenced by receive_any(), and receive_anyN().

int PostOffice::_send XMLData   data,
Address   remote,
int    nonblocking,
secure_method    s = sm_plain
[private]
 

Definition at line 13 of file PostOffice.cpp.

References Buffer::buffer(), crypter, Crypter::buffer::data, DBUG_PRINT, XMLData::getAttrib(), XMLData::print(), Crypter::private_sign(), Crypter::public_encrypt(), XMLData::reset(), secure_method, UDPConfirm::sendData(), UDPConfirm::sendDataN(), Buffer::setCrt(), Crypter::buffer::size, sm_crypt, sm_plain, sm_sign, CharStr::str, XMLData::sub(), XMLData::tag(), uchar, udp, and uint.

Referenced by send(), and sendN().

send_state PostOffice::checkN int    messageID
 

Definition at line 145 of file PostOffice.cpp.

References UDPConfirm::checkN(), send_state, and udp.

Referenced by Master::checkingThread().

void PostOffice::deleteN int    messageID
 

Definition at line 150 of file PostOffice.cpp.

References UDPConfirm::deleteN(), and udp.

Referenced by Master::checkingThread().

void PostOffice::getLocalPort uint   ports [inline]
 

Definition at line 250 of file PostOffice.h.

References UDPConfirm::getLocalPort(), and uint.

uint PostOffice::getLocalPort   [inline]
 

Definition at line 245 of file PostOffice.h.

References UDPConfirm::getLocalPort(), and uint.

Referenced by Client::Client(), and Slave::detectSlaveInfo().

void PostOffice::inbox   [private]
 

Definition at line 422 of file PostOffice.cpp.

References Buffer::buffer(), crypter, Crypter::buffer::data, DBUG_PRINT, finish, XMLData::getString(), noSecPlain, Crypter::private_decrypt(), Crypter::public_verify(), put_back(), XMLData::ReadError, sigThread(), Crypter::buffer::size, CharStr::str, XMLData::tag(), uchar, udp, uint, UDPConfirm::waitData(), and XMLData.

void PostOffice::init_sockets   [inline, static]
 

Definition at line 154 of file PostOffice.h.

References DBUG_PRINT, and Address::init_thishost().

Referenced by execSlave(), Client::init_sockets(), Master::Master(), and upgrade_slaves().

int PostOffice::initialized   [inline]
 

Definition at line 224 of file PostOffice.h.

Referenced by Client::Client(), Master::Master(), Slave::Slave(), and upgrade_slaves().

void PostOffice::purgeIn Address   remote
 

Definition at line 590 of file PostOffice.cpp.

References UDPConfirm::purgeIn(), and udp.

Referenced by Master::msgClientStatus_Off(), and Master::msgJobCtrl_Stop().

void PostOffice::put_back Address   addr,
XMLData   data
 

Definition at line 541 of file PostOffice.cpp.

References List::Add(), ItemSender::addr, ItemDataIn::data, ItemSender::data, DBUG_PRINT, Address::equals(), List::Get_First(), List::Get_Next(), XMLData::getAttrib(), Lock::lock(), lock, Semaphore::post(), queue, receiveOrder, XMLData::reset(), sem, ItemSender::sem, CharStr::str, XMLData::sub(), XMLData::tag(), and Lock::unlock().

Referenced by Client::_taskCreate(), inbox(), Client::taskCtrl(), and Client::wait_for().

XMLData * PostOffice::receive Address   remote = NULL,
int    timeout = NO_TIMEOUT
 

Definition at line 163 of file PostOffice.cpp.

References _receive(), and NO_TIMEOUT.

Referenced by upgrade_slaves(), Client::wait_for(), and Client::waitMaster().

XMLData * PostOffice::receive_any Address   remote,
int    timeout = NO_TIMEOUT
 

Definition at line 278 of file PostOffice.cpp.

References _receive_any(), and NO_TIMEOUT.

Referenced by Master::startMaster(), Slave::startSlave(), and Client::wait_for().

XMLData * PostOffice::receive_anyN Address   remote
 

Definition at line 287 of file PostOffice.cpp.

References _receive_any().

XMLData * PostOffice::receiveN Address   remote = NULL
 

Definition at line 156 of file PostOffice.cpp.

References _receive().

void PostOffice::release_sockets   [inline, static]
 

Definition at line 171 of file PostOffice.h.

References DBUG_PRINT.

Referenced by Client::release_sockets(), upgrade_slaves(), Master::~Master(), and Slave::~Slave().

int PostOffice::send XMLData   data,
Address   remote = NULL,
secure_method    s = sm_plain
 

Definition at line 135 of file PostOffice.cpp.

References _send(), and secure_method.

Referenced by Client::send(), Slave::sndSlaveStatus(), Slave::sndTaskFinish(), Slave::sndTaskStatus(), and upgrade_slaves().

int PostOffice::sendN XMLData   data,
Address   remote = NULL,
secure_method    s = sm_plain
 

Definition at line 140 of file PostOffice.cpp.

References _send(), and secure_method.

Referenced by Master::checkingThread(), Master::sndMessageToClient(), and Master::sndMessageToSlave().

void PostOffice::setCrypter Crypter   crypter
 

Definition at line 595 of file PostOffice.cpp.

void PostOffice::setRemote Address   remote [inline]
 

Definition at line 328 of file PostOffice.h.

References UDPConfirm::setRemote().

Referenced by Client::Client(), Slave::Slave(), Slave::startTimer(), upgrade_slaves(), and Client::wait_for().

void PostOffice::stopWait Address   remote
 

Definition at line 382 of file PostOffice.cpp.

References ItemSender::addr, Address::equals(), List::Get_First(), List::Get_Next(), interrupted, Lock::lock(), lock, Semaphore::post(), queue, ItemSender::sem, sem, Lock::unlock(), and Semaphore::value().

Referenced by Master::consoleInThread().


Friends And Related Function Documentation

void* inbox_entry void *    arg [friend]
 


Member Data Documentation

int PostOffice::catchSignal [private]
 

Definition at line 120 of file PostOffice.h.

Crypter* PostOffice::crypter [private]
 

Definition at line 117 of file PostOffice.h.

Referenced by _send(), and inbox().

int PostOffice::finish [private]
 

Definition at line 114 of file PostOffice.h.

Referenced by inbox().

int PostOffice::init_ok [private]
 

Definition at line 121 of file PostOffice.h.

int PostOffice::interrupted [private]
 

Definition at line 116 of file PostOffice.h.

Referenced by _receive(), _receive_any(), and stopWait().

int PostOffice::localPort [private]
 

Definition at line 115 of file PostOffice.h.

Lock PostOffice::lock [private]
 

Definition at line 112 of file PostOffice.h.

Referenced by _receive(), _receive_any(), put_back(), and stopWait().

int PostOffice::noSecPlain [private]
 

Definition at line 119 of file PostOffice.h.

Referenced by inbox().

List PostOffice::queue [private]
 

Definition at line 109 of file PostOffice.h.

Referenced by _receive(), _receive_any(), put_back(), and stopWait().

XMLData * PostOffice::ReceiveInterrupted = &recInterrupted [static]
 

Definition at line 8 of file PostOffice.cpp.

Referenced by _receive(), _receive_any(), and Master::startMaster().

List PostOffice::receiveOrder [private]
 

Definition at line 110 of file PostOffice.h.

Referenced by _receive(), _receive_any(), and put_back().

thread_handle PostOffice::recThread [private]
 

Definition at line 113 of file PostOffice.h.

Semaphore PostOffice::sem [private]
 

Definition at line 111 of file PostOffice.h.

Referenced by _receive(), _receive_any(), put_back(), and stopWait().

XMLData * PostOffice::Timeout = &timout [static]
 

Definition at line 11 of file PostOffice.cpp.

Referenced by _receive(), _receive_any(), Slave::startSlave(), Client::wait_for(), and Client::waitMaster().

UDPConfirm PostOffice::udp [private]
 

Definition at line 108 of file PostOffice.h.

Referenced by _send(), checkN(), deleteN(), inbox(), and purgeIn().


The documentation for this class was generated from the following files:
Generated on Mon Nov 25 12:46:40 2002 for qadpz by doxygen1.2.18