VTK  9.7.1
vtkServerSocket.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
10 #ifndef vtkServerSocket_h
11 #define vtkServerSocket_h
12 
13 #include "vtkCommonSystemModule.h" // For export macro
14 #include "vtkSocket.h"
15 
16 VTK_ABI_NAMESPACE_BEGIN
17 class vtkClientSocket;
18 class VTKCOMMONSYSTEM_EXPORT vtkServerSocket : public vtkSocket
19 {
20 public:
21  static vtkServerSocket* New();
22  vtkTypeMacro(vtkServerSocket, vtkSocket);
23  void PrintSelf(ostream& os, vtkIndent indent) override;
24 
26 
31  int CreateServer(int port, const std::string& bindAddr);
32  int CreateServer(int port);
34 
40  VTK_NEWINSTANCE vtkClientSocket* WaitForConnection(unsigned long msec = 0);
41 
45  int GetServerPort();
46 
47 protected:
49  ~vtkServerSocket() override;
50 
51 private:
52  vtkServerSocket(const vtkServerSocket&) = delete;
53  void operator=(const vtkServerSocket&) = delete;
54 };
55 
56 VTK_ABI_NAMESPACE_END
57 #endif
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
Encapsulate a socket that accepts connections.
a simple class to control print indentation
Definition: vtkIndent.h:28
#define VTK_NEWINSTANCE
BSD socket encapsulation.
Definition: vtkSocket.h:19
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
Encapsulates a client socket.