vtkTCPNetworkAccessManager.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-License-Identifier: BSD-3-Clause
11 #ifndef vtkTCPNetworkAccessManager_h
12 #define vtkTCPNetworkAccessManager_h
13 
15 #include "vtkRemotingCoreModule.h" //needed for exports
16 
18 
20 {
21 public:
24  void PrintSelf(ostream& os, vtkIndent indent) override;
25 
27 
67  const char* url, vtkNetworkAccessManager::ConnectionResult& result) override;
69 
74  void AbortPendingConnection() override;
75 
79  int ProcessEvents(unsigned long timeout_msecs) override;
80 
86  bool GetNetworkEventsAvailable() override;
87 
91  bool GetPendingConnectionsPresent() override;
92 
96  void DisableFurtherConnections(int port, bool disable) override;
97 
101  bool GetWrongConnectID() override;
102 
103 protected:
105  ~vtkTCPNetworkAccessManager() override;
106 
107  // used by GetPendingConnectionsPresent and ProcessEvents
108  int ProcessEventsInternal(unsigned long timeout_msecs, bool do_processing);
109 
113  vtkMultiProcessController* ConnectToRemote(const char* hostname, int port, const char* handshake,
114  int timeout_in_seconds, vtkNetworkAccessManager::ConnectionResult& result);
115 
119  vtkMultiProcessController* WaitForConnection(int port, bool once, const char* handshake,
120  bool nonblocking, vtkNetworkAccessManager::ConnectionResult& result);
121 
123  {
124  HANDSHAKE_NO_ERROR = 0,
129  HANDSHAKE_UNKNOWN_ERROR
130  };
131 
132  int ParaViewHandshake(
133  vtkMultiProcessController* controller, bool server_side, const char* handshake);
134  void PrintHandshakeError(int errorcode, bool server_side);
135  int AnalyzeHandshakeAndGetErrorCode(const char* clientHS, const char* serverHS);
136 
139 
140 private:
142  void operator=(const vtkTCPNetworkAccessManager&) = delete;
143 
144  class vtkInternals;
145  vtkInternals* Internals;
146 };
147 
148 #endif
virtual bool GetNetworkEventsAvailable()=0
Peeks to check if any activity is available.
void PrintSelf(ostream &os, vtkIndent indent) override
vtkTCPNetworkAccessManager is a concrete implementation of vtkNetworkAccessManager that uses tcp/ip s...
virtual int ProcessEvents(unsigned long timeout_msecs)=0
Process any network activity.
virtual bool GetPendingConnectionsPresent()=0
Returns true is the manager is currently waiting for any connections.
#define VTKREMOTINGCORE_EXPORT
virtual bool GetWrongConnectID()=0
Returns true if the last check of connect ids was wrong.
virtual void DisableFurtherConnections(int port, bool disable)=0
Enable/disable further connections for given port.
virtual vtkMultiProcessController * NewConnection(const char *url)
Creates a new connection given the url.
virtual void AbortPendingConnection()=0
Used to abort pending connection creation, if any.
vtkNetworkAccessManager is used to create new connections and monitor activity of those connections...
static vtkObject * New()
ConnectionResult
Possible result of connection when creating a new connection CONNECTION_SUCCESS: Connection was suces...