VTK  9.3.0
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
29 int CreateServer(int port);
30
36 vtkClientSocket* WaitForConnection(unsigned long msec = 0);
37
42
43protected:
45 ~vtkServerSocket() override;
46
47private:
48 vtkServerSocket(const vtkServerSocket&) = delete;
49 void operator=(const vtkServerSocket&) = delete;
50};
51
52VTK_ABI_NAMESPACE_END
53#endif
Encapsulates a client socket.
a simple class to control print indentation
Definition vtkIndent.h:29
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)
Creates a server socket at a given port and binds to it.
~vtkServerSocket() override
BSD socket encapsulation.
Definition vtkSocket.h:20