VTK  9.3.20240327
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 
29  int CreateServer(int port);
30 
37 
42 
43 protected:
45  ~vtkServerSocket() override;
46 
47 private:
48  vtkServerSocket(const vtkServerSocket&) = delete;
49  void operator=(const vtkServerSocket&) = delete;
50 };
51 
52 VTK_ABI_NAMESPACE_END
53 #endif
Encapsulates a client socket.
a simple class to control print indentation
Definition: vtkIndent.h:108
Encapsulate a socket that accepts connections.
int GetServerPort()
Returns the port on which the server is running.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static vtkServerSocket * New()
int CreateServer(int port)
Creates a server socket at a given port and binds to it.
vtkClientSocket * WaitForConnection(unsigned long msec=0)
Waits for a connection.
~vtkServerSocket() override
BSD socket encapsulation.
Definition: vtkSocket.h:20
@ port
Definition: vtkX3D.h:447
#define VTK_NEWINSTANCE