49 #include <visp/vpClient.h>
54 std::string servername =
"localhost";
55 unsigned int port = 35000;
65 if(client.
send(&val) !=
sizeof(int))
66 std::cout <<
"Error while sending" << std::endl;
68 std::cout <<
"Sending : " << val << std::endl;
70 if(client.
receive(&val) !=
sizeof(int))
71 std::cout <<
"Error while receiving" << std::endl;
73 std::cout <<
"Received : " << val << std::endl;
78 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))