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 
19 class VTKREMOTINGCORE_EXPORT vtkTCPNetworkAccessManager : public vtkNetworkAccessManager
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,
130  // Not an error: same major.minor but different build versions. Connect with a warning.
131  // Releases put only major.minor in the handshake (6.2.0 and 6.2.1 both send 6.2), so
132  // they never get this. Development builds add a date as the build version
133  // (e.g. 6.2.20261020).
134  HANDSHAKE_DIFFERENT_BUILD_VERSIONS
135  };
136 
137  int ParaViewHandshake(
138  vtkMultiProcessController* controller, bool server_side, const char* handshake);
139  void PrintHandshakeError(int errorcode, bool server_side);
140  int AnalyzeHandshakeAndGetErrorCode(const char* clientHS, const char* serverHS);
141 
144 
145 private:
147  void operator=(const vtkTCPNetworkAccessManager&) = delete;
148 
149  class vtkInternals;
150  vtkInternals* Internals;
151 };
152 
153 #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.
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...