34#ifndef VP_UDP_CLIENT_H
35#define VP_UDP_CLIENT_H
37#include <visp3/core/vpConfig.h>
40#ifdef VISP_HAVE_FUNC_INET_NTOP
42#if !defined(_WIN32) && (defined(__unix__) || defined(__unix) || (defined(__APPLE__) && defined(__MACH__)))
43#include <netinet/in.h>
44#include <sys/socket.h>
50# pragma clang diagnostic push
51# pragma clang diagnostic ignored "-Wnonportable-system-include-path"
57# pragma clang diagnostic pop
62#include <visp3/core/vpException.h>
64#define VP_MAX_UDP_PAYLOAD 508
190 vpUDPClient(
const std::string &hostname,
int port);
197 void init(
const std::string &hostname,
int port);
199 int receive(std::string &msg,
int timeoutMs = 0);
200 int receive(
void *msg,
size_t len,
int timeoutMs = 0);
201 int send(
const std::string &msg);
202 int send(
const void *msg,
size_t len);
209 char m_buf[VP_MAX_UDP_PAYLOAD];
210 struct sockaddr_in m_serverAddress;
212#if !defined(_WIN32) && (defined(__unix__) || defined(__unix) || (defined(__APPLE__) && defined(__MACH__)))
213 int m_socketFileDescriptor;
215 SOCKET m_socketFileDescriptor;
int receive(std::string &msg, int timeoutMs=0)
void init(const std::string &hostname, int port)
vpUDPClient & operator=(const vpUDPClient &client)
int send(const std::string &msg)