An example of how to use the EchoLink::Dispatcher class
#include <iostream>
#include <cstdlib>
#include <AsyncCppApplication.h>
using namespace std;
using namespace Async;
class MyClass : public sigc::trackable
{
public:
MyClass(void)
{
if (Dispatcher::instance() == 0)
{
cerr << "Could not create EchoLink listener (Dispatcher) object\n";
exit(1);
}
Dispatcher::instance()->incomingConnection.connect(mem_fun(*this,
&MyClass::onIncomingConnection));
}
private:
void onIncomingConnection(const IpAddress& ip, const string& callsign,
const string& name, const string& priv)
{
cerr << "Incoming connection from " << ip << ": " << callsign
<< " (" << name << ")\n";
}
};
int main(int argc, char **argv)
{
CppApplication app;
MyClass my_class;
app.exec();
}