VTK  9.3.20240328
vtkClientSocket.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
8 #ifndef vtkClientSocket_h
9 #define vtkClientSocket_h
10 
11 #include "vtkCommonSystemModule.h" // For export macro
12 #include "vtkSocket.h"
13 VTK_ABI_NAMESPACE_BEGIN
14 class vtkServerSocket;
15 
16 class VTKCOMMONSYSTEM_EXPORT vtkClientSocket : public vtkSocket
17 {
18 public:
19  static vtkClientSocket* New();
20  vtkTypeMacro(vtkClientSocket, vtkSocket);
21  void PrintSelf(ostream& os, vtkIndent indent) override;
22 
26  int ConnectToServer(const char* hostname, int port);
27 
29 
35  vtkGetMacro(ConnectingSide, bool);
37 
38 protected:
40  ~vtkClientSocket() override;
41 
42  vtkSetMacro(ConnectingSide, bool);
44  friend class vtkServerSocket;
45 
46 private:
47  vtkClientSocket(const vtkClientSocket&) = delete;
48  void operator=(const vtkClientSocket&) = delete;
49 };
50 
51 VTK_ABI_NAMESPACE_END
52 #endif
Encapsulates a client socket.
int ConnectToServer(const char *hostname, int port)
Connects to host.
~vtkClientSocket() override
static vtkClientSocket * New()
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
a simple class to control print indentation
Definition: vtkIndent.h:108
Encapsulate a socket that accepts connections.
BSD socket encapsulation.
Definition: vtkSocket.h:20
@ port
Definition: vtkX3D.h:447