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

UDPSocket Class Reference

#include <UDPSocket.h>

Inheritance diagram for UDPSocket:

Object List of all members.

Public Methods

 UDPSocket ()
 ~UDPSocket ()
int createSocket (int port=0, int flag=UDP_PORT_STRICT|UDP_DATA_NONE)
int closeSocket ()
int setRemote (uint host, int port)
int getRemote (uint &host, int &port)
int getLocalPort ()
uint getLocalAddr ()
int sendData (Buffer *data, uint host, int port)
int sendData (const char *buff, int len, uint host, int port)
int waitData (Buffer *data, uint &host, int &port)
int waitData (char *data, int &len, uint &host, int &port)
int waitDataN (char *data, int &len, uint &host, int &port, int timeout)
virtual int compare (Object *)
virtual ObjectCopy ()

Private Methods

int sendto (const char *buff, int len)
int recvfrom (char *buff, int &len, uint &host, int &port)

Private Attributes

int sockfd
sockaddr_in remote_addr local_addr
int remote_port
int local_port
uint remote_host
int m_flag

Constructor & Destructor Documentation

UDPSocket::UDPSocket  
 

Definition at line 30 of file UDPSocket.cpp.

References local_port, m_flag, remote_host, remote_port, sockfd, and UDP_DATA_NONE.

UDPSocket::~UDPSocket  
 

Definition at line 42 of file UDPSocket.cpp.


Member Function Documentation

int UDPSocket::closeSocket  
 

Definition at line 145 of file UDPSocket.cpp.

References sockfd.

Referenced by UDPConfirm::closeSocket().

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 UDPSocket::createSocket int    port = 0,
int    flag = UDP_PORT_STRICT|UDP_DATA_NONE
 

Definition at line 54 of file UDPSocket.cpp.

References DBUG_PRINT, local_addr, local_port, m_flag, sockfd, and UDP_PORT_STRICT.

Referenced by UDPConfirm::createSocket().

uint UDPSocket::getLocalAddr  
 

Definition at line 129 of file UDPSocket.cpp.

References DBUG_PRINT, and uint.

Referenced by UDPConfirm::getLocalAddr().

int UDPSocket::getLocalPort  
 

Definition at line 123 of file UDPSocket.cpp.

References local_port.

Referenced by UDPConfirm::getLocalPort().

int UDPSocket::getRemote uint   host,
int &    port
 

Definition at line 99 of file UDPSocket.cpp.

References remote_host, remote_port, and uint.

Referenced by UDPConfirm::sendData(), and UDPConfirm::sendDataN().

int UDPSocket::recvfrom char *    buff,
int &    len,
uint   host,
int &    port
[private]
 

Definition at line 392 of file UDPSocket.cpp.

References m_flag, sockfd, UDP_DATA_BZIP2, UDP_MAXSIZE, and uint.

Referenced by waitData().

int UDPSocket::sendData const char *    buff,
int    len,
uint    host,
int    port
 

Definition at line 157 of file UDPSocket.cpp.

References DBUG_PRINT, ZTime::Now(), ZTime::print(), remote_host, remote_port, sendto(), setRemote(), and uint.

int UDPSocket::sendData Buffer   data,
uint    host,
int    port
 

Definition at line 183 of file UDPSocket.cpp.

References Buffer::buffer(), DBUG_PRINT, Buffer::getId(), ZTime::Now(), ZTime::print(), remote_host, remote_port, sendto(), setRemote(), SZ_UINT, uchar, and uint.

int UDPSocket::sendto const char *    buff,
int    len
[private]
 

Definition at line 227 of file UDPSocket.cpp.

References DBUG_PRINT, m_flag, sockfd, UDP_DATA_BZIP2, and UDP_MAXSIZE.

Referenced by sendData().

int UDPSocket::setRemote uint    host,
int    port
 

Definition at line 108 of file UDPSocket.cpp.

References remote_host, remote_port, and uint.

Referenced by sendData(), and UDPConfirm::setRemote().

int UDPSocket::waitData char *    data,
int &    len,
uint   host,
int &    port
 

Definition at line 309 of file UDPSocket.cpp.

References DBUG_PRINT, ZTime::Now(), ZTime::print(), recvfrom(), SOCK_ERRNO, and uint.

int UDPSocket::waitData Buffer   data,
uint   host,
int &    port
 

Definition at line 339 of file UDPSocket.cpp.

References Buffer::buffer(), Buffer::clear(), DBUG_PRINT, Buffer::getId(), ZTime::Now(), ZTime::print(), recvfrom(), Buffer::setCrt(), SZ_UINT, uchar, UDP_MAXSIZE, and uint.

Referenced by UDPConfirm::waitData(), and waitDataN().

int UDPSocket::waitDataN char *    data,
int &    len,
uint   host,
int &    port,
int    timeout
 

Definition at line 279 of file UDPSocket.cpp.

References sockfd, UDP_TIMEOUT, uint, and waitData().


Member Data Documentation

struct sockaddr_in remote_addr UDPSocket::local_addr [private]
 

Definition at line 42 of file UDPSocket.h.

Referenced by createSocket().

int UDPSocket::local_port [private]
 

Definition at line 45 of file UDPSocket.h.

Referenced by createSocket(), getLocalPort(), and UDPSocket().

int UDPSocket::m_flag [private]
 

Definition at line 50 of file UDPSocket.h.

Referenced by createSocket(), recvfrom(), sendto(), and UDPSocket().

uint UDPSocket::remote_host [private]
 

Definition at line 48 of file UDPSocket.h.

Referenced by getRemote(), sendData(), setRemote(), and UDPSocket().

int UDPSocket::remote_port [private]
 

Definition at line 45 of file UDPSocket.h.

Referenced by getRemote(), sendData(), setRemote(), and UDPSocket().

int UDPSocket::sockfd [private]
 

Definition at line 41 of file UDPSocket.h.

Referenced by closeSocket(), createSocket(), recvfrom(), sendto(), UDPSocket(), and waitDataN().


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