class PUDPSocket

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

Inheritance:


Public Methods

[more] Construction
[more] Overrides from class PSocket
[more] New functions for class


Inherited from PIPDatagramSocket:

Public Methods

ovirtual BOOL ReadFrom( void* buf, PINDEX len, Address & addr, WORD & port )
ovirtual BOOL WriteTo( const void* buf, PINDEX len, const Address & addr, WORD port )


Inherited from PIPSocket:

Public Methods

ovirtual PString GetName() const
ovirtual BOOL Connect( const PString & address )
ovirtual BOOL Listen( unsigned queueSize = 5, WORD port = 0, Reusability reuse = AddressIsExclusive )
ostatic PString GetHostName()
ostatic BOOL GetHostAddress( Address & addr )
ostatic PStringArray GetHostAliases( const PString & hostname )
ostatic BOOL IsLocalHost( const PString & hostname )
ovirtual BOOL GetLocalAddress( Address & addr )
ovirtual BOOL GetPeerAddress( Address & addr )
oPString GetLocalHostName()
oPString GetPeerHostName()
ostatic void ClearNameCache()
ostatic BOOL GetGatewayAddress( Address & addr )
ostatic PString GetGatewayInterface()
ostatic BOOL GetRouteTable( RouteTable & table )
ostatic BOOL GetInterfaceTable( InterfaceTable & table )

Public Members

class Address: public PObject
A class describing an IP address
class RouteEntry: public PObject
Describes a route table entry
class InterfaceEntry: public PObject
Describes an interface table entry


Inherited from PSocket:

Public Methods

Socket establishment functions

Socket options functions

Port/Service database functions

Integer conversion functions

Public Members

Multiple socket selection functions

Protected Fields

oWORD port

Protected Methods

ovirtual const char* GetProtocolName() const


Inherited from PChannel:

Public Methods

Overrides from class PObject

Information functions

Reading functions

Writing functions

Miscellaneous functions

ostatic BOOL ConvertOSError( int libcReturnValue, Errors & lastError, int & osError )

Public Members

Error functions

Protected Fields

oint os_handle
oErrors lastErrorCode[NumErrorGroups+1]
oint lastErrorNumber[NumErrorGroups+1]
oPINDEX lastReadCount
oPINDEX lastWriteCount
oPTimeInterval readTimeout
oPTimeInterval writeTimeout

Protected Methods

ovirtual BOOL ConvertOSError( int libcReturnValue, ErrorGroup group = LastGeneralError )
oBOOL SetErrorValues( Errors errorCode, int osError, ErrorGroup group = LastGeneralError )
oint ReadCharWithTimeout( PTimeInterval & timeout )


Inherited from PObject:

Public Methods

Run Time Type functions

I/O functions

Public Members

Comparison functions


Documentation

A socket channel that uses the UDP transport on the Internet Protocol
o Construction

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

o Overrides from class PSocket

oBOOL Read( void* buf, PINDEX len )
Override of PChannel functions to allow connectionless reads
Parameters:
buf - Pointer to a block of memory to read.
len - Number of bytes to read.

oBOOL Write( const void* buf, PINDEX len )
Override of PChannel functions to allow connectionless writes
Parameters:
buf - Pointer to a block of memory to write.
len - Number of bytes to write.

oBOOL Connect( const PString & address )
Override of PSocket functions to allow connectionless writes
Parameters:
address - Address of remote machine to connect to.

o New functions for class

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

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

ovirtual BOOL ModifyQoSSpec( PQoS* qos )
Change the QOS spec for the socket and try to apply the changes
Parameters:
qos - QoS specification to use

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


Direct child classes:
PSocksUDPSocket

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.