29 #ifndef CFI_UDPSOCKET_H
30 #define CFI_UDPSOCKET_H
35 #include <sys/socket.h>
36 #include <netinet/in.h>
71 void operator = (
const UDPSocket & ) =
delete;
99 void recv( std::string &message, std::string &host,
int &port );
A UDP client socket.
Definition: udpsocket.h:110
int sd
file descriptor
Definition: udpsocket.h:76
unsigned int addr_len
size of address structure
Definition: udpsocket.h:75
void recv(std::string &message, std::string &host, int &port)
wait for the next incoming message
Definition: udpsocket.cpp:78
UDPSocket()
constructor
Definition: udpsocket.cpp:44
An abstract base class with common stuff for UDP sockets.
Definition: udpsocket.h:56
int fd()
get the file descriptor for the socket
Definition: udpsocket.h:85
virtual ~UDPSocket()
destructor
Definition: udpsocket.cpp:55
UDPServerSocket(int portid)
Constructor.
Definition: udpsocket.cpp:124
UDPClientSocket(csr host, int portid)
Constructor.
Definition: udpsocket.cpp:98
void send(csr message, csr host, int port)
send message to specified host and port. Used for replies.
Definition: udpsocket.cpp:138
struct sockaddr_in addr
internal address structure
Definition: udpsocket.h:74
static const int BUFFER_SIZE
Definition: udpsocket.h:64
const std::string & csr
Save some time typing and shorten parameter lines.
Definition: stringy.h:35
void send(csr message)
send a message via the socket's file descriptor
Definition: udpsocket.cpp:64
A UDP Server socket.
Definition: udpsocket.h:130