PUDPSocket Class Reference

#include <udpsock.h>

Inheritance diagram for PUDPSocket:

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

New functions for class

void SetSendAddress (const Address &address, WORD port)
void GetSendAddress (Address &address, WORD &port)
virtual PBoolean ModifyQoSSpec (PQoS *qos)
void GetLastReceiveAddress (Address &address, WORD &port)
static PBoolean SupportQoS (const PIPSocket::Address &address)
static void EnableGQoS ()

Public Member Functions

Construction
 PUDPSocket (WORD port=0, int iAddressFamily=AF_INET)
 PUDPSocket (PQoS *qos, WORD port=0, int iAddressFamily=AF_INET)
 PUDPSocket (const PString &service, PQoS *qos=NULL, int iAddressFamily=AF_INET)
 PUDPSocket (const PString &address, WORD port)
 PUDPSocket (const PString &address, const PString &service)
Overrides from class PSocket
PBoolean Read (void *buf, PINDEX len)
PBoolean Write (const void *buf, PINDEX len)
PBoolean Connect (const PString &address)

Protected Member Functions

virtual PBoolean OpenSocket ()
virtual PBoolean OpenSocket (int ipAdressFamily)
virtual PBoolean OpenSocketGQOS (int af, int type, int proto)
virtual PBoolean 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,
int  iAddressFamily = AF_INET 
)

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.
iAddressFamily  Family

PUDPSocket::PUDPSocket ( PQoS qos,
WORD  port = 0,
int  iAddressFamily = AF_INET 
)

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

PUDPSocket::PUDPSocket ( const PString service,
PQoS qos = NULL,
int  iAddressFamily = AF_INET 
)

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

PUDPSocket::PUDPSocket ( const PString address,
WORD  port 
)

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

PUDPSocket::PUDPSocket ( const PString address,
const PString service 
)

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


Member Function Documentation

virtual PBoolean PUDPSocket::ApplyQoS (  )  [protected, virtual]

PBoolean 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.

static void PUDPSocket::EnableGQoS (  )  [static]

Manually Enable GQoS Support

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:
address  IP address to send packets.
port  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:
address  IP address to send packets.
port  Port to send packets.

virtual PBoolean 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 PBoolean PUDPSocket::OpenSocket ( int  ipAdressFamily  )  [protected, virtual]

Open an IPv4 or IPv6 socket

Implements PIPSocket.

virtual PBoolean PUDPSocket::OpenSocket (  )  [protected, virtual]

Implements PSocket.

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

PBoolean PUDPSocket::Read ( void *  buf,
PINDEX  len 
) [virtual]

Override of PChannel functions to allow connectionless reads

Parameters:
buf  Pointer to a block of memory to read.
len  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:
address  IP address to send packets.
port  Port to send packets.

static PBoolean PUDPSocket::SupportQoS ( const PIPSocket::Address address  )  [static]

Check to See if the socket will support QoS on the given local Address

PBoolean PUDPSocket::Write ( const void *  buf,
PINDEX  len 
) [virtual]

Override of PChannel functions to allow connectionless writes

Parameters:
buf  Pointer to a block of memory to write.
len  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 Thu May 27 01:36:50 2010 for PTLib by  doxygen 1.4.7