#include #include #include #include #include #include "vtkClientSocket.h" #include "vtkSmartPointer.h" unsigned int PORT = 2500; int main(int argc, const char * argv[]) { vtkSmartPointer Client = vtkSmartPointer::New(); int error_code = Client->ConnectToServer("localhost", PORT); if (error_code == 0) { std::cout << "CLIENT\t" << "Connected to server on port " << PORT << std::endl; int i = 0; int recvTag = -1; while (i < 1000) { // Send copied from vtk implementation, should definitely work... int tag = 7; Client->Send(&tag, static_cast(sizeof(int))); std::cout << i++ << "\tCLIENT\t" << "Sent " << tag << std::endl; std::this_thread::sleep_for(std::chrono::milliseconds(10)); } } else { std::cout << "CLIENT\t" << "Error: Failed to create server"; } }