VICI  0.11.815
Visual Chart Interpreter
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
VICI::cfi::UDPSocket Class Reference

An abstract base class with common stuff for UDP sockets. More...

#include <sos/udpsocket.h>

Inheritance diagram for VICI::cfi::UDPSocket:
VICI::cfi::UDPClientSocket VICI::cfi::UDPServerSocket

Public Member Functions

virtual ~UDPSocket ()
 destructor
 
int fd ()
 get the file descriptor for the socket
 
void send (csr message)
 send a message via the socket's file descriptor More...
 
void recv (std::string &message, std::string &host, int &port)
 wait for the next incoming message More...
 

Static Public Attributes

static const int BUFFER_SIZE = 16000
 

Protected Member Functions

 UDPSocket ()
 constructor
 

Protected Attributes

struct sockaddr_in addr
 internal address structure
 
unsigned int addr_len
 size of address structure
 
int sd
 file descriptor
 

Detailed Description

An abstract base class with common stuff for UDP sockets.

The common code for client and server udp sockets which manages the file descriptor and the buffer for the messages.

Member Function Documentation

void UDPSocket::recv ( std::string &  message,
std::string &  host,
int &  port 
)

wait for the next incoming message

Parameters
messagea string into which the message is placed
hostthe host name of the sending machine
portthe port of the sending machine.
void UDPSocket::send ( csr  message)

send a message via the socket's file descriptor

Parameters
messagethe text to send.

Member Data Documentation

const int VICI::cfi::UDPSocket::BUFFER_SIZE = 16000
static

the max size for udp packets is 64K but we should keep them as small as possible and send several if needs be.


The documentation for this class was generated from the following files: