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

UDPConfirm Class Reference

#include <UDPConfirm.h>

Inheritance diagram for UDPConfirm:

Object List of all members.

Public Methods

 UDPConfirm (int catchSignal=0)
 ~UDPConfirm ()
int createSocket (int port=0, int n=1, int flag=UDP_PORT_STRICT)
void closeSocket ()
void setRemote (Address &remote)
void getLocalPort (uint *ports)
int getLocalPort ()
uint getLocalAddr ()
int sendData (Buffer *data)
int sendData (Buffer *data, Address &remote)
uint sendDataN (Buffer *data)
uint sendDataN (Buffer *data, Address &remote)
send_state checkN (uint msgId)
void deleteN (uint msgId)
int waitData (Buffer *data, Address &remote)
void stopWait ()
void purgeIn (Address &remote)
int check ()
virtual int compare (Object *)
virtual ObjectCopy ()

Private Methods

ItemDataOutsendIt (Buffer *data, Address &remote)
int sendItem (ItemDataOut *item)
uint nextId ()
int checkList ()
int deleteList ()
int insertItem (ItemDataOut *item)
int deleteItem (ItemDataOut *item)
int deleteId (uint id)
ItemDataOutisItem (uint id, Address &remote)
int sendConfirm (uint id, Address &remote)
int isConfirm (uint id, Address &remote)
int insertConfirm (uint id, Address &remote)
void sendStop ()
int getRandPort ()

Private Attributes

THRD_HANDLE sendThread
int finish
UDPSocketsock
int * sockfd
int sockn
int sockmax
Lock lockO
List lOut
Lock lockI
List lIn
uint idCrt
int catchSignal

Constructor & Destructor Documentation

UDPConfirm::UDPConfirm int    catchSignal = 0
 

Definition at line 26 of file UDPConfirm.cpp.

References catchSignal, idCrt, sock, sockfd, sockmax, and sockn.

UDPConfirm::~UDPConfirm  
 

Definition at line 37 of file UDPConfirm.cpp.

References closeSocket().


Member Function Documentation

int UDPConfirm::check  
 

Definition at line 483 of file UDPConfirm.cpp.

References checkList(), DBUG_PRINT, finish, sigThread(), and SLEEP_MSEC.

int UDPConfirm::checkList   [private]
 

Definition at line 514 of file UDPConfirm.cpp.

References ItemDataOut::addr, ItemDataOut::block, List::Count(), ItemDataOut::countsent, DBUG_PRINT, List::Get_Next(), Address::getIP(), ItemDataInR::id, ItemDataOut::id, lIn, Lock::lock(), lockI, lockO, lOut, ZTime::Now(), Semaphore::post(), List::Remove(), send_confirm, send_timeout, sendItem(), List::Start_Get(), ItemDataOut::stat, ItemDataInR::timeout, ItemDataOut::timeout, ItemDataInR::timerecv, ItemDataOut::timesent, and Lock::unlock().

Referenced by check().

send_state UDPConfirm::checkN uint    msgId
 

Definition at line 157 of file UDPConfirm.cpp.

References List::Count(), List::Get_Next(), ItemDataOut::id, Lock::lock(), lockO, lOut, send_buffered, send_buffered_new, send_buffered_sent, send_invalid, send_state, List::Start_Get(), ItemDataOut::stat, uint, and Lock::unlock().

Referenced by PostOffice::checkN().

void UDPConfirm::closeSocket  
 

Definition at line 78 of file UDPConfirm.cpp.

References UDPSocket::closeSocket(), finish, SLEEP_MSEC, sock, sockfd, and sockn.

Referenced by ~UDPConfirm().

virtual int Object::compare Object   [inline, virtual, inherited]
 

To ensure a consistent comparison interface and to allow comparison of all kinds of different objects, we will define a comparison functions.

Definition at line 31 of file Object.h.

virtual Object* Object::Copy   [inline, virtual, inherited]
 

To allow a deep copy of data structures we will define a standard interface... This member will return a copy of itself, freshly allocated and deep copied.

Reimplemented in List.

Definition at line 37 of file Object.h.

Referenced by List::Copy(), and List::operator=().

int UDPConfirm::createSocket int    port = 0,
int    n = 1,
int    flag = UDP_PORT_STRICT
 

Definition at line 43 of file UDPConfirm.cpp.

References UDPSocket::createSocket(), DBUG_PRINT, finish, outbox_entry(), sendThread, sock, sockfd, sockmax, sockn, startThread(), and UDP_PORT_ITERATE.

Referenced by PostOffice::PostOffice().

int UDPConfirm::deleteId uint    id [private]
 

Definition at line 611 of file UDPConfirm.cpp.

References List::Count(), List::Get_Next(), ItemDataOut::id, Lock::lock(), lockO, lOut, List::Remove(), List::Start_Get(), uint, and Lock::unlock().

int UDPConfirm::deleteItem ItemDataOut   item [private]
 

Definition at line 602 of file UDPConfirm.cpp.

References lOut, and List::Remove().

Referenced by deleteN(), and sendData().

int UDPConfirm::deleteList   [private]
 

Definition at line 581 of file UDPConfirm.cpp.

References List::Destroy(), Lock::lock(), lockO, lOut, and Lock::unlock().

void UDPConfirm::deleteN uint    msgId
 

Definition at line 186 of file UDPConfirm.cpp.

References List::Count(), deleteItem(), List::Get_Next(), ItemDataOut::id, Lock::lock(), lockO, lOut, List::Start_Get(), uint, and Lock::unlock().

Referenced by PostOffice::deleteN().

uint UDPConfirm::getLocalAddr  
 

Definition at line 120 of file UDPConfirm.cpp.

References UDPSocket::getLocalAddr(), sock, and uint.

Referenced by sendStop().

int UDPConfirm::getLocalPort  
 

Definition at line 114 of file UDPConfirm.cpp.

References UDPSocket::getLocalPort(), and sock.

void UDPConfirm::getLocalPort uint   ports
 

Definition at line 107 of file UDPConfirm.cpp.

References UDPSocket::getLocalPort(), sock, sockn, and uint.

Referenced by PostOffice::getLocalPort(), and sendStop().

int UDPConfirm::getRandPort   [private]
 

Definition at line 287 of file UDPConfirm.cpp.

References sockn.

Referenced by sendConfirm(), and sendItem().

int UDPConfirm::insertConfirm uint    id,
Address   remote
[private]
 

Definition at line 679 of file UDPConfirm.cpp.

References List::Add(), lIn, Lock::lock(), lockI, ZTime::Now(), ItemDataInR::timerecv, uint, and Lock::unlock().

Referenced by waitData().

int UDPConfirm::insertItem ItemDataOut   item [private]
 

Definition at line 593 of file UDPConfirm.cpp.

References List::Add(), and lOut.

Referenced by sendIt().

int UDPConfirm::isConfirm uint    id,
Address   remote
[private]
 

Definition at line 654 of file UDPConfirm.cpp.

References ItemDataInR::addr, List::Count(), List::Get_Next(), ItemDataInR::id, lIn, Lock::lock(), lockI, ZTime::Now(), List::Start_Get(), ItemDataInR::timerecv, uint, and Lock::unlock().

Referenced by waitData().

ItemDataOut * UDPConfirm::isItem uint    id,
Address   remote
[private]
 

Definition at line 634 of file UDPConfirm.cpp.

References ItemDataOut::addr, List::Count(), List::Get_Next(), ItemDataOut::id, Lock::lock(), lockO, lOut, List::Start_Get(), uint, and Lock::unlock().

Referenced by waitData().

uint UDPConfirm::nextId   [private]
 

Definition at line 475 of file UDPConfirm.cpp.

References idCrt, and uint.

Referenced by sendIt().

void UDPConfirm::purgeIn Address   remote
 

Definition at line 704 of file UDPConfirm.cpp.

References ItemDataInR::addr, DBUG_PRINT, List::Get_Next(), Address::getIP(), lIn, Lock::lock(), lockI, List::Remove(), List::Start_Get(), and Lock::unlock().

Referenced by PostOffice::purgeIn().

int UDPConfirm::sendConfirm uint    id,
Address   remote
[private]
 

Definition at line 320 of file UDPConfirm.cpp.

References DBUG_PRINT, Address::getHost(), Address::getPort(), getRandPort(), Lock::lock(), lockO, sendData(), Buffer::setId(), sock, uint, and Lock::unlock().

Referenced by waitData().

int UDPConfirm::sendData Buffer   data,
Address   remote
 

Definition at line 224 of file UDPConfirm.cpp.

References ItemDataOut::block, DBUG_PRINT, deleteItem(), ItemDataOut::id, Lock::lock(), lockO, send_confirm, sendIt(), ItemDataOut::stat, Lock::unlock(), and Semaphore::wait().

int UDPConfirm::sendData Buffer   data
 

Definition at line 210 of file UDPConfirm.cpp.

References UDPSocket::getRemote(), sock, and uint.

Referenced by PostOffice::_send(), sendConfirm(), sendItem(), and sendStop().

uint UDPConfirm::sendDataN Buffer   data,
Address   remote
 

Definition at line 142 of file UDPConfirm.cpp.

References DBUG_PRINT, ItemDataOut::id, sendIt(), and uint.

uint UDPConfirm::sendDataN Buffer   data
 

Definition at line 127 of file UDPConfirm.cpp.

References UDPSocket::getRemote(), sock, and uint.

Referenced by PostOffice::_send().

ItemDataOut * UDPConfirm::sendIt Buffer   data,
Address   remote
[private]
 

Definition at line 257 of file UDPConfirm.cpp.

References ItemDataOut::addr, DBUG_PRINT, Address::getIP(), ItemDataOut::id, insertItem(), Lock::lock(), lockO, nextId(), sendItem(), and Lock::unlock().

Referenced by sendData(), and sendDataN().

int UDPConfirm::sendItem ItemDataOut   item [private]
 

Definition at line 299 of file UDPConfirm.cpp.

References ItemDataOut::addr, ItemDataOut::countsent, ItemDataOut::data, Address::getHost(), Address::getPort(), getRandPort(), ItemDataOut::id, ZTime::Now(), send_buffered_sent, send_err, sendData(), Buffer::setId(), sock, ItemDataOut::stat, and ItemDataOut::timesent.

Referenced by checkList(), and sendIt().

void UDPConfirm::sendStop   [private]
 

Definition at line 347 of file UDPConfirm.cpp.

References DBUG_PRINT, getLocalAddr(), getLocalPort(), Lock::lock(), lockO, sendData(), Buffer::setId(), sock, and Lock::unlock().

Referenced by stopWait().

void UDPConfirm::setRemote Address   remote
 

Definition at line 100 of file UDPConfirm.cpp.

References Address::getHost(), Address::getPort(), UDPSocket::setRemote(), sock, and sockn.

Referenced by PostOffice::setRemote().

void UDPConfirm::stopWait  
 

Definition at line 695 of file UDPConfirm.cpp.

References sendStop().

Referenced by PostOffice::~PostOffice().

int UDPConfirm::waitData Buffer   data,
Address   remote
 

Definition at line 377 of file UDPConfirm.cpp.

References ItemDataOut::block, DBUG_PRINT, Buffer::getId(), insertConfirm(), isConfirm(), isItem(), Semaphore::post(), send_confirm, sendConfirm(), Address::setHost(), Address::setPort(), sock, sockfd, sockmax, sockn, ItemDataOut::stat, uchar, uint, and UDPSocket::waitData().

Referenced by PostOffice::inbox().


Member Data Documentation

int UDPConfirm::catchSignal [private]
 

Definition at line 116 of file UDPConfirm.h.

Referenced by UDPConfirm().

int UDPConfirm::finish [private]
 

Definition at line 102 of file UDPConfirm.h.

Referenced by check(), closeSocket(), and createSocket().

uint UDPConfirm::idCrt [private]
 

Definition at line 115 of file UDPConfirm.h.

Referenced by nextId(), and UDPConfirm().

List UDPConfirm::lIn [private]
 

Definition at line 113 of file UDPConfirm.h.

Referenced by checkList(), insertConfirm(), isConfirm(), and purgeIn().

Lock UDPConfirm::lockI [private]
 

Definition at line 112 of file UDPConfirm.h.

Referenced by checkList(), insertConfirm(), isConfirm(), and purgeIn().

Lock UDPConfirm::lockO [private]
 

Definition at line 109 of file UDPConfirm.h.

Referenced by checkList(), checkN(), deleteId(), deleteList(), deleteN(), isItem(), sendConfirm(), sendData(), sendIt(), and sendStop().

List UDPConfirm::lOut [private]
 

Definition at line 110 of file UDPConfirm.h.

Referenced by checkList(), checkN(), deleteId(), deleteItem(), deleteList(), deleteN(), insertItem(), and isItem().

THRD_HANDLE UDPConfirm::sendThread [private]
 

Definition at line 101 of file UDPConfirm.h.

Referenced by createSocket().

UDPSocket* UDPConfirm::sock [private]
 

Definition at line 104 of file UDPConfirm.h.

Referenced by closeSocket(), createSocket(), getLocalAddr(), getLocalPort(), sendConfirm(), sendData(), sendDataN(), sendItem(), sendStop(), setRemote(), UDPConfirm(), and waitData().

int* UDPConfirm::sockfd [private]
 

Definition at line 105 of file UDPConfirm.h.

Referenced by closeSocket(), createSocket(), UDPConfirm(), and waitData().

int UDPConfirm::sockmax [private]
 

Definition at line 107 of file UDPConfirm.h.

Referenced by createSocket(), UDPConfirm(), and waitData().

int UDPConfirm::sockn [private]
 

Definition at line 106 of file UDPConfirm.h.

Referenced by closeSocket(), createSocket(), getLocalPort(), getRandPort(), setRemote(), UDPConfirm(), and waitData().


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