Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Class Members | File Members

PUDPSocket Class Reference

#include <udpsock.h>

Inheritance diagram for PUDPSocket:

PIPDatagramSocket PIPSocket PSocket PChannel PObject PSocksUDPSocket PSTUNUDPSocket List of all members.

Public Member Functions

Construction
 PUDPSocket (WORD port=0)
 PUDPSocket (PQoS *qos, WORD port=0)
 PUDPSocket (const PString &service, PQoS *qos=NULL)
 PUDPSocket (const PString &address, WORD port)
 PUDPSocket (const PString &address, const PString &service)
Overrides from class PSocket
BOOL Read (void *buf, PINDEX len)
BOOL Write (const void *buf, PINDEX len)
BOOL Connect (const PString &address)
New functions for class
void SetSendAddress (const Address &address, WORD port)
void GetSendAddress (Address &address, WORD &port)
virtual BOOL ModifyQoSSpec (PQoS *qos)
void GetLastReceiveAddress (Address &address, WORD &port)

Protected Member Functions

virtual BOOL OpenSocket ()
virtual BOOL OpenSocket (int ipAdressFamily)
virtual int OpenSocketGQOS (int af, int type, int proto)
virtual BOOL ApplyQoS ()
virtual const char * GetProtocolName () const

Protected Attributes

Address sendAddress
WORD sendPort
Address lastReceiveAddress
WORD lastReceivePort
PQoS qosSpec

Detailed Description

A socket channel that uses the UDP transport on the Internet Protocol.


Constructor & Destructor Documentation

PUDPSocket::PUDPSocket WORD  port = 0  ) 
 

Create a UDP socket. If a remote machine address or a "listening" socket is specified then the channel is also opened.

Parameters:
port  Port number to use for the connection.

PUDPSocket::PUDPSocket PQoS qos,
WORD  port = 0
 

Parameters:
port  Pointer to a QOS structure for the connection Port number to use for the connection.

PUDPSocket::PUDPSocket const PString service,
PQoS qos = NULL
 

Parameters:
qos  Service name to use for the connection. Pointer to a QOS structure for the connection

PUDPSocket::PUDPSocket const PString address,
WORD  port
 

Parameters:
port  Address of remote machine to connect to. Port number to use for the connection.

PUDPSocket::PUDPSocket const PString address,
const PString service
 

Parameters:
service  Address of remote machine to connect to. Service name to use for the connection.


Member Function Documentation

virtual BOOL PUDPSocket::ApplyQoS  )  [protected, virtual]
 

BOOL PUDPSocket::Connect const PString address  )  [virtual]
 

Override of PSocket functions to allow connectionless writes

Parameters:
address  Address of remote machine to connect to.

Reimplemented from PIPSocket.

Reimplemented in PSocksUDPSocket.

void PUDPSocket::GetLastReceiveAddress Address &  address,
WORD &  port
 

Get the address of the sender in the last connectionless Read(). Note that thsi only applies to the Read() and not the ReadFrom() function.

Parameters:
port  IP address to send packets. Port to send packets.

virtual const char* PUDPSocket::GetProtocolName  )  const [protected, virtual]
 

This function returns the protocol name for the socket type.

Implements PSocket.

void PUDPSocket::GetSendAddress Address &  address,
WORD &  port
 

Get the address to use for connectionless Write().

Parameters:
port  IP address to send packets. Port to send packets.

virtual BOOL PUDPSocket::ModifyQoSSpec PQoS qos  )  [virtual]
 

Change the QOS spec for the socket and try to apply the changes

Parameters:
qos  QoS specification to use

virtual BOOL PUDPSocket::OpenSocket int  ipAdressFamily  )  [protected, virtual]
 

Implements PIPSocket.

virtual BOOL PUDPSocket::OpenSocket  )  [protected, virtual]
 

Implements PSocket.

virtual int PUDPSocket::OpenSocketGQOS int  af,
int  type,
int  proto
[protected, virtual]
 

BOOL PUDPSocket::Read void *  buf,
PINDEX  len
[virtual]
 

Override of PChannel functions to allow connectionless reads

Parameters:
len  Pointer to a block of memory to read. Number of bytes to read.

Reimplemented from PSocket.

void PUDPSocket::SetSendAddress const Address &  address,
WORD  port
 

Set the address to use for connectionless Write() or Windows QoS

Parameters:
port  IP address to send packets. Port to send packets.

BOOL PUDPSocket::Write const void *  buf,
PINDEX  len
[virtual]
 

Override of PChannel functions to allow connectionless writes

Parameters:
len  Pointer to a block of memory to write. Number of bytes to write.

Reimplemented from PChannel.


Member Data Documentation

Address PUDPSocket::lastReceiveAddress [protected]
 

WORD PUDPSocket::lastReceivePort [protected]
 

PQoS PUDPSocket::qosSpec [protected]
 

Address PUDPSocket::sendAddress [protected]
 

WORD PUDPSocket::sendPort [protected]
 


The documentation for this class was generated from the following file:
Generated on Mon Feb 21 20:43:17 2005 for PWLib by  doxygen 1.4.1