Hi,
I am new to VTK and try to connect the vtkServerSocket to my TCP Client (Putty).
I tried this:
vtkSmartPointer<vtkServerSocket> ssocket = vtkSmartPointer<vtkServerSocket>::New();
vtkSmartPointer<vtkSocketController> socketController =vtkSmartPointer<vtkSocketController>::New();
vtkSmartPointer<vtkSocketCommunicator> socketCommunicator = vtkSmartPointer<vtkSocketCommunicator>::New();
socketController->SetCommunicator(socketCommunicator);
socketController->Initialize();
ssocket->CreateServer(port);
int response;
while (true)
{
printf("waiting...");
response= socketCommunicator->WaitForConnection(ssocket,100);
if (response == 1) {
printf("connected");
break;
}
}
But it doesnt work as expected and as soon as Putty is trying to connect vtk stops working in this line “response= socketCommunicator->WaitForConnection(ssocket,100);” and doesnt go further. Can someone help me?