vtkTCPNetworkAccessManager.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: vtkTCPNetworkAccessManager.h
5 
6  Copyright (c) Kitware, Inc.
7  All rights reserved.
8  See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
23 #ifndef vtkTCPNetworkAccessManager_h
24 #define vtkTCPNetworkAccessManager_h
25 
27 #include "vtkRemotingCoreModule.h" //needed for exports
28 
30 
32 {
33 public:
36  void PrintSelf(ostream& os, vtkIndent indent) override;
37 
39 
79  const char* url, vtkNetworkAccessManager::ConnectionResult& result) override;
81 
86  void AbortPendingConnection() override;
87 
91  int ProcessEvents(unsigned long timeout_msecs) override;
92 
98  bool GetNetworkEventsAvailable() override;
99 
103  bool GetPendingConnectionsPresent() override;
104 
108  void DisableFurtherConnections(int port, bool disable) override;
109 
113  bool GetWrongConnectID() override;
114 
115 protected:
117  ~vtkTCPNetworkAccessManager() override;
118 
119  // used by GetPendingConnectionsPresent and ProcessEvents
120  int ProcessEventsInternal(unsigned long timeout_msecs, bool do_processing);
121 
125  vtkMultiProcessController* ConnectToRemote(const char* hostname, int port, const char* handshake,
126  int timeout_in_seconds, vtkNetworkAccessManager::ConnectionResult& result);
127 
131  vtkMultiProcessController* WaitForConnection(int port, bool once, const char* handshake,
132  bool nonblocking, vtkNetworkAccessManager::ConnectionResult& result);
133 
135  {
136  HANDSHAKE_NO_ERROR = 0,
141  HANDSHAKE_UNKNOWN_ERROR
142  };
143 
144  int ParaViewHandshake(
145  vtkMultiProcessController* controller, bool server_side, const char* handshake);
146  void PrintHandshakeError(int errorcode, bool server_side);
147  int AnalyzeHandshakeAndGetErrorCode(const char* clientHS, const char* serverHS);
148 
151 
152 private:
154  void operator=(const vtkTCPNetworkAccessManager&) = delete;
155 
156  class vtkInternals;
157  vtkInternals* Internals;
158 };
159 
160 #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...