# VtkSockets connection to not VTK Socket

**URL:** https://discourse.vtk.org/t/vtksockets-connection-to-not-vtk-socket/1870
**Category:** Support
**Created:** [October 4, 2019, 6:28pm UTC](https://discourse.vtk.org/t/vtksockets-connection-to-not-vtk-socket/1870 "2019-10-04T18:28:27Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Alex1](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/a/898d66/32.png) [@Alex1](https://discourse.vtk.org/u/Alex1)
#### Post date: [October 4, 2019, 6:28pm UTC](https://discourse.vtk.org/t/vtksockets-connection-to-not-vtk-socket/1870/1 "2019-10-04T18:28:27Z")

</div>

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?
