37 #ifndef ECHOLINK_DISPATCHER_INCLUDED
38 #define ECHOLINK_DISPATCHER_INCLUDED
47 #include <sigc++/sigc++.h>
58 #include <AsyncIpAddress.h>
59 #include <AsyncUdpSocket.h>
209 sigc::signal<void,
const Async::IpAddress&,
const std::string&,
217 typedef void (
Qso::*CtrlInputHandler)(
unsigned char *buf,
int len);
218 typedef void (
Qso::*AudioInputHandler)(
unsigned char *buf,
int len);
222 CtrlInputHandler cih;
223 AudioInputHandler aih;
225 typedef std::map<Async::IpAddress, ConData> ConMap;
227 static const int DEFAULT_PORT_BASE = 5198;
229 static int port_base;
230 static Async::IpAddress bind_ip;
234 Async::UdpSocket * ctrl_sock;
235 Async::UdpSocket * audio_sock;
237 bool registerConnection(
Qso *con, CtrlInputHandler cih,
238 AudioInputHandler aih);
239 void unregisterConnection(
Qso *con);
242 void ctrlDataReceived(
const Async::IpAddress& ip, uint16_t port,
244 void audioDataReceived(
const Async::IpAddress& ip, uint16_t port,
246 void printData(
const char *buf,
int len);
249 bool sendCtrlMsg(
const Async::IpAddress& to,
const void *buf,
int len);
250 bool sendAudioMsg(
const Async::IpAddress& to,
const void *buf,
int len);
A class for handling incoming connections and dispatch active connections.
sigc::signal< void, const Async::IpAddress &, const std::string &, const std::string &, const std::string & > incomingConnection
A signal that is emitted when someone is trying to connect.
static Dispatcher * instance(void)
Get the Singleton instance.
static void setBindAddr(const Async::IpAddress &ip)
Set the bind address for the two UDP ports.
static void setPortBase(int base)
Set the port base for the two UDP ports.
static void deleteInstance(void)
Delete the singleton object if it exists.
~Dispatcher(void)
Destructor.
A class for creating an EchoLink connection.
Namespace to encapsulate EchoLink communication classes.