34#ifndef ASYNC_UDP_SOCKET_INCLUDED
35#define ASYNC_UDP_SOCKET_INCLUDED
44#include <sigc++/sigc++.h>
149 virtual bool initOk(
void)
const {
return (sock != -1); }
172 const void *buf,
int count);
179 virtual int fd(
void)
const {
return sock; }
188 sigc::signal<void, const IpAddress&, uint16_t, void*, int>
dataReceived;
205 UdpPacket * send_buf;
208 void handleInput(
FdWatch *watch);
Platform independent representation of an IP address.
A class for watching file descriptors.
A class for representing an IP address in an OS independent way.
A class for working with UDP sockets.
virtual ~UdpSocket(void)
Destructor.
uint16_t localPort(void) const
Get the local UDP port associated with this connection.
Async::IpAddress localAddr(void) const
Get the local IP address associated with this connection.
virtual bool write(const IpAddress &remote_ip, int remote_port, const void *buf, int count)
Write data to the remote host.
virtual int fd(void) const
Get the file descriptor for the UDP socket.
sigc::signal< void, bool > sendBufferFull
A signal that is emitted when the send buffer is full.
sigc::signal< void, const IpAddress &, uint16_t, void *, int > dataReceived
A signal that is emitted when data has been received.
UdpSocket(uint16_t local_port=0, const IpAddress &bind_ip=IpAddress())
Constructor.
virtual bool initOk(void) const
Check if the initialization was ok.
virtual void onDataReceived(const IpAddress &ip, uint16_t port, void *buf, int count)
Namespace for the asynchronous programming classes.