Go to the documentation of this file.
34 #ifndef ASYNC_UDP_SOCKET_INCLUDED
35 #define ASYNC_UDP_SOCKET_INCLUDED
44 #include <sigc++/sigc++.h>
124 class UdpSocket :
public sigc::trackable
134 UdpSocket(uint16_t local_port=0,
const IpAddress &bind_ip=IpAddress());
149 bool initOk(
void)
const {
return (sock != -1); }
159 bool write(
const IpAddress& remote_ip,
int remote_port,
const void *buf,
167 int fd(
void)
const {
return sock; }
176 sigc::signal<void, const IpAddress&, uint16_t, void*, int>
dataReceived;
191 UdpPacket * send_buf;
194 void handleInput(
FdWatch *watch);
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(void)
Destructor.
bool write(const IpAddress &remote_ip, int remote_port, const void *buf, int count)
Write data to the remote host.
Platform independent representation of an IP address.
int fd(void) const
Get the file descriptor for the UDP socket.
bool initOk(void) const
Check if the initialization was ok.
Namespace for the asynchronous programming classes.
UdpSocket(uint16_t local_port=0, const IpAddress &bind_ip=IpAddress())
Constructor.
A class for watching file descriptors.