Public Member Functions

CxUtils::UdpServer Class Reference

Socket structure for receiving and UDP/IP messages. More...

#include <udpserver.h>

Inheritance diagram for CxUtils::UdpServer:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 UdpServer ()
 Default constructor.
virtual ~UdpServer ()
 Default constructor.
int InitializeSocket (const unsigned short port)
 Initializes as a socket for connecting to a UDP server.
int InitializeMulticastSocket (const unsigned short port, const IP4Address &multicastGroup, const bool allowReuse=false)
 Initializes as a socket for connecting to a UDP server.
virtual void Shutdown ()
 Closes the socket.

Detailed Description

Socket structure for receiving and UDP/IP messages.

Just like UdpClient, UdpServer is one way communication and can only be used to receive UDP data. To transmit you must us a UdpClient.

Definition at line 58 of file udpserver.h.


Constructor & Destructor Documentation

UdpServer::UdpServer (  )

Default constructor.

Definition at line 58 of file udpserver.cpp.

UdpServer::~UdpServer (  ) [virtual]

Default constructor.

Definition at line 74 of file udpserver.cpp.


Member Function Documentation

int UdpServer::InitializeMulticastSocket ( const unsigned short  port,
const IP4Address multicastGroup,
const bool  allowReuse = false 
)

Initializes as a socket for connecting to a UDP server.

Parameters:
[in]portThe port to use.
[in]multicastGroupThe multicast group to connect to. This is an IP address in the range of "224.0.0.0-239.255.255.255"
[in]allowReuseIf true, then multiple udp server sockets can run on single host. If you need multiple sockets with the same port, you should use the UdpSharedServer instead. However, if you are only using multicast, then this is OK to be true.
Returns:
1 if socket created, otherwise 0.

Definition at line 252 of file udpserver.cpp.

int UdpServer::InitializeSocket ( const unsigned short  port )

Initializes as a socket for connecting to a UDP server.

Parameters:
[in]portThe port to use.
Returns:
1 if socket created, otherwise 0.

Definition at line 114 of file udpserver.cpp.

void UdpServer::Shutdown (  ) [virtual]

Closes the socket.

Reimplemented from CxUtils::Socket.

Definition at line 84 of file udpserver.cpp.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines