About
The User Datagram Protocol allows to send messages across networks without connections. The maxon::NetworkUdpInterface is used to create a sender to send UDP messages or to create a server to receive messages.
- Note
- The UDP interface uses an AioService. See maxon::AioServiceInterface.
NetworkUdpInterface
The maxon::NetworkUdpInterface provides these functions:
NetworkUdpServerInterface
The maxon::NetworkUdpServerInterface controls an UDP server that can receive UDP data:
g_udpServer =
maxon::NetworkUdpInterface::CreateUdpServer(localAddr, UDPCallback, g_ioService)
iferr_return;
NetworkUdpSenderInterface
The maxon::NetworkUdpSenderInterface allows to send data via UDP to a remote machine.
const maxon::AioServiceRef service = maxon::AioServiceRef::Create()
iferr_return;
maxon::CString messageCStr("Test Message");
{
err.DbgStop();
}
NetworkUdpChannelInterface
maxon::NetworkUdpChannelInterfac represents an asynchronous UDP channel that can both receive data and send data:
g_channelIoService = maxon::AioServiceRef::Create()
iferr_return;
g_udpChannel =
maxon::NetworkUdpInterface::CreateUdpChannel(localAddr, g_channelIoService)
iferr_return;
Further Reading