An example of how to use the Async::UdpSocket class
#include <iostream>
using namespace std;
class MyClass :
public sigc::trackable
{
public:
{
sock->dataReceived.connect(
mem_fun(*
this, &MyClass::onDataReceived));
sock->write(
addr, 12345,
"Hello, UDP!\n", 13);
}
{
delete sock;
}
private:
{
cout <<
"Data received from " <<
addr <<
":" <<
port <<
": "
<< static_cast<char *>(buf);
Application::app().quit();
}
};
{
}
The core class for writing asyncronous cpp applications.
Platform independent representation of an IP address.
Contains a class for using UDP sockets.
An application class for writing non GUI applications.
void exec(void)
Execute the application main loop.
A class for representing an IP address in an OS independent way.
A class for creating a TCP client connection.
A class for working with UDP sockets.
Namespace for the asynchronous programming classes.