VTKFIG  0.20.20181114
Easy VTK based in situ visualization
void vtkfig::internals::MainThread::OpenConnection ( int  port,
int  wtime 
)
private

Open connection to client.

Definition at line 114 of file vtkfigMainThread-2018-01-26-2205.cxx.

115  {
116  if (connection_open) return;
117 
118  cout << "Server start listening on port "<< port << endl;
119  communicator=vtkSmartPointer<Communicator>::New();
120  communicator->server_listen_num_retry=1;
121  communicator->server_listen_waiting_time=1000*wtime;
122  int rc=communicator->ServerConnect(port);
123  if (rc)
124  cout << "Server connected" << endl;
125  else
126  {
127  cout << "Nobody is listening ... giving up" << endl;
128  throw std::runtime_error("Server connection failed");
129  exit(1);
130  }
131  connection_open=true;
132  }
vtkSmartPointer< Communicator > communicator
Communicator object for communication with cliend.
bool connection_open
State of connection to client.