46 #include <visp3/core/vpClient.h> 51 #ifdef VISP_HAVE_FUNC_INET_NTOP 53 std::string servername =
"localhost";
54 unsigned int port = 35000;
63 if (client.
send(&val) !=
sizeof(int))
64 std::cout <<
"Error while sending" << std::endl;
66 std::cout <<
"Sending : " << val << std::endl;
68 if (client.
receive(&val) !=
sizeof(int))
69 std::cout <<
"Error while receiving" << std::endl;
71 std::cout <<
"Received : " << val << std::endl;
75 std::cout <<
"Catch an exception: " << e << std::endl;
79 std::cout <<
"This test doesn't work on win XP where inet_ntop() is not available" << 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))