IGT vtkMRMLIGTLConnectorNode best way to know how long to wait for connection and node access?

Operating system: Ubuntu16.04.4
Slicer version: 4.8.1

connectorNodeNav = slicer.vtkMRMLIGTLConnectorNode()

print “NumberOfIncomingMRMLNodes=”, connectorNodeNav.GetNumberOfIncomingMRMLNodes()

How long to wait before I get correct values?
Line above yields 0 in interpreter if I paste code above in one go and 3 as expected if I wait a bit before pasting the last line. This code in a module always yields zero. Advice? Block on something?

1 Like

Connections are managed in background threads. If you want to know when a client is connected then add an observer to the connector node.