VTK  9.4.20250207
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
16VTK_ABI_NAMESPACE_BEGIN
17class vtkClientSocket;
18class VTKCOMMONSYSTEM_EXPORT vtkServerSocket : public vtkSocket
19{
20public:
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
41
46
47protected:
49 ~vtkServerSocket() override;
50
51private:
52 vtkServerSocket(const vtkServerSocket&) = delete;
53 void operator=(const vtkServerSocket&) = delete;
54};
55
56VTK_ABI_NAMESPACE_END
57#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.
static vtkServerSocket * New()
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkClientSocket * WaitForConnection(unsigned long msec=0)
Waits for a connection.
int CreateServer(int port, const std::string &bindAddr)
Creates a server socket at a given port and binds given IPV4 address to it.
int CreateServer(int port)
Creates a server socket at a given port and binds given IPV4 address to it.
~vtkServerSocket() override
BSD socket encapsulation.
Definition vtkSocket.h:20
#define VTK_NEWINSTANCE