45 #include <visp3/core/vpClient.h>
50 std::string servername =
"localhost";
51 unsigned int port = 35000;
61 if(client.
send(&val) !=
sizeof(int))
62 std::cout <<
"Error while sending" << std::endl;
64 std::cout <<
"Sending : " << val << std::endl;
66 if(client.
receive(&val) !=
sizeof(int))
67 std::cout <<
"Error while receiving" << std::endl;
69 std::cout <<
"Received : " << val << std::endl;
74 std::cout <<
"Catch an exception: " << e << std::endl;
error that can be emited by ViSP classes.
int send(T *object, const int unsigned &sizeOfObject=sizeof(T))
bool connectToHostname(const std::string &hostname, const unsigned int &port_serv)
This class represents a Transmission Control Protocol (TCP) client.
int receive(T *object, const unsigned int &sizeOfObject=sizeof(T))