ProcessModule And Connections

From ParaQ Wiki
Jump to navigationJump to search


This document describes how to use the process module with multiple remote connections.


  • Every process can have only one instance of vtkProcessModule. ProcessModule is a singleton and this fact is relied upon every where in the ServerManager. Hence it is an error to create more than one instance of a process module in any process.
  • vtkProcessModule has support for multiple remote connections (vtkRemoteConnection). Howevever, by default it is set up to behave the ParaView way:
    • In forward connection mode:
      • Server waits for client at start.
      • Client connects to server before GUI starts (in render-client mode, client connects to data server and render server).
      • Once a client connects, the server closes its server sockets so that no more clients can connect to it.
      • When client disconnects, server exits.
    • In reverse connection mode:
      • Client waits for server at start, before GUI starts.
      • Server connects to client at start.
      • When client disconnects, server exits.
  • To override this behaviour, vtkProcessModule provides the SupportMultipleConnections flag, which must be set before calling vtkProcessModule::Start().
  • When this flag is set:
    • In forward connection mode:
      • Server sets up server sockets and waits for the client at start.
      • If a client connects, the server still keeps the server sockets open and accepts any new client connections comming on the socket.
      • When a client disconnects the server simply closes the connections and processes other connections as well as accepts new incoming connections.
      • Client does not attempt to connect to the server in Start(). Instead vtkProcessModule::ConnectToRemote() must be explicitly called.
      • Client can connect to more that 1 server using ConnectToRemote().
    • In reverse connection mode:
      • The server can connect to only one client, which it attempts to connect at start.
      • The server exits when the client connection is closed.
      • The client does not wait for any server connections at the start. Instead vtkProcessModule::MonitorConnections() must be called to accept any incoming server connection requests.