Socket structure for receiving and UDP/IP messages. More...
#include <udpserver.h>
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. |
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.
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.
int UdpServer::InitializeMulticastSocket | ( | const unsigned short | port, |
const IP4Address & | multicastGroup, | ||
const bool | allowReuse = false |
||
) |
Initializes as a socket for connecting to a UDP server.
[in] | port | The port to use. |
[in] | multicastGroup | The multicast group to connect to. This is an IP address in the range of "224.0.0.0-239.255.255.255" |
[in] | allowReuse | If 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. |
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.
[in] | port | The port to use. |
Definition at line 114 of file udpserver.cpp.
void UdpServer::Shutdown | ( | ) | [virtual] |