Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  
igtlServerSocket.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: The OpenIGTLink Library
4 Language: C++
5 Web page: http://openigtlink.org/
6
7 Copyright (c) Insight Software Consortium. All rights reserved.
8
9 This software is distributed WITHOUT ANY WARRANTY; without even
10 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11 PURPOSE. See the above copyright notices for more information.
12
13=========================================================================*/
14/*=========================================================================
15
16 Program: Visualization Toolkit
17 Module: $RCSfile: vtkServerSocket.h,v $
18
19 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
20 All rights reserved.
21 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
22
23 This software is distributed WITHOUT ANY WARRANTY; without even
24 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
25 PURPOSE. See the above copyright notice for more information.
26
27=========================================================================*/
28// .NAME igtlServerSocket - Encapsulate a socket that accepts connections.
29// .SECTION Description
30//
31
32#ifndef __igtlServerSocket_h
33#define __igtlServerSocket_h
34
35#include "igtlSocket.h"
36#include "igtlClientSocket.h"
37#include "igtlWin32Header.h"
38
39namespace igtl
40{
41
43{
44public:
49
52
53 // Description:
54 // Creates a server socket at a given port and binds to it.
55 // Returns -1 on error. 0 on success.
56 int CreateServer(int port);
57
58 // Description:
59 // Waits for a connection. When a connection is received
60 // a new ClientSocket object is created and returned.
61 // Returns NULL on timeout.
62 //ClientSocket* WaitForConnection(unsigned long msec=0);
64
65 // Description:
66 // Returns the port on which the server is running.
68protected:
71
72 void PrintSelf(std::ostream& os) const;
73
74private:
75 ServerSocket(const ServerSocket&); // Not implemented.
76 void operator=(const ServerSocket&); // Not implemented.
77};
78
79} // end of igtl namespace
80
81
82#endif
83
igtlNewMacro(igtl::ServerSocket)
int CreateServer(int port)
igtlTypeMacro(igtl::ServerSocket, igtl::Socket)
ClientSocket::Pointer WaitForConnection(unsigned long msec=0)
SmartPointer< const Self > ConstPointer
SmartPointer< Self > Pointer
void PrintSelf(std::ostream &os) const
Implements transparent reference counting.
class IGTL_EXPORT Socket
Definition igtlSocket.h:62
#define IGTLCommon_EXPORT
The "igtl" namespace contains all OpenIGTLink classes. There are several nested namespaces within the...

Generated for OpenIGTLink by Doxygen 1.9.8 written by Dimitri van Heesch, © 1997-2012