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 
74  vtkMultiProcessController* NewConnection(const char* url) override;
75 
80  void AbortPendingConnection() override;
81 
85  int ProcessEvents(unsigned long timeout_msecs) override;
86 
92  bool GetNetworkEventsAvailable() override;
93 
97  bool GetPendingConnectionsPresent() override;
98 
102  virtual void DisableFurtherConnections(int port, bool disable) override;
103 
107  virtual bool GetWrongConnectID() override;
108 
109 protected:
111  ~vtkTCPNetworkAccessManager() override;
112 
113  // used by GetPendingConnectionsPresent and ProcessEvents
114  int ProcessEventsInternal(unsigned long timeout_msecs, bool do_processing);
115 
119  vtkMultiProcessController* ConnectToRemote(
120  const char* hostname, int port, const char* handshake, int timeout_in_seconds);
121 
125  vtkMultiProcessController* WaitForConnection(
126  int port, bool once, const char* handshake, bool nonblocking);
127 
129  {
130  HANDSHAKE_NO_ERROR = 0,
135  HANDSHAKE_UNKNOWN_ERROR
136  };
137 
138  int ParaViewHandshake(
139  vtkMultiProcessController* controller, bool server_side, const char* handshake);
140  void PrintHandshakeError(int errorcode, bool server_side);
141  int AnalyzeHandshakeAndGetErrorCode(const char* clientHS, const char* serverHS);
142 
145 
146 private:
148  void operator=(const vtkTCPNetworkAccessManager&) = delete;
149 
150  class vtkInternals;
151  vtkInternals* Internals;
152 };
153 
154 #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)=0
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()