36 #ifndef __vpUDPClient_h__ 37 #define __vpUDPClient_h__ 39 #include <visp3/core/vpConfig.h> 41 #if !defined(_WIN32) && (defined(__unix__) || defined(__unix) || (defined(__APPLE__) && defined(__MACH__))) // UNIX 42 #include <netinet/in.h> 43 #include <sys/socket.h> 44 #include <sys/types.h> 49 #include <visp3/core/vpException.h> 51 #define VP_MAX_UDP_PAYLOAD 508 168 vpUDPClient(
const std::string &hostname,
const int port);
171 int receive(std::string &msg,
const int timeoutMs = 0);
172 int send(
const std::string &msg);
175 char m_buf[VP_MAX_UDP_PAYLOAD];
176 struct sockaddr_in m_serverAddress;
178 #if !defined(_WIN32) && (defined(__unix__) || defined(__unix) || (defined(__APPLE__) && defined(__MACH__))) // UNIX 179 int m_socketFileDescriptor;
181 SOCKET m_socketFileDescriptor;
185 void init(
const std::string &hostname,
const int port);
This class implements a basic (IPv4) User Datagram Protocol (UDP) client.