Main Page
Namespace List
Class Hierarchy
Alphabetical List
Compound List
File List
Namespace Members
Compound Members
File Members
Source
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
39
namespace
igtl
40
{
41
42
class
IGTLCommon_EXPORT
ServerSocket
:
public
Socket
43
{
44
public
:
45
typedef
ServerSocket
Self
;
46
typedef
Socket
Superclass
;
47
typedef
SmartPointer<Self>
Pointer
;
48
typedef
SmartPointer<const Self>
ConstPointer
;
49
50
igtlTypeMacro
(
igtl::ServerSocket
,
igtl::Socket
);
51
igtlNewMacro
(
igtl::ServerSocket
);
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);
63
ClientSocket::Pointer
WaitForConnection(
unsigned
long
msec=0);
64
65
// Description:
66
// Returns the port on which the server is running.
67
int
GetServerPort();
68
protected
:
69
ServerSocket
();
70
~
ServerSocket
();
71
72
void
PrintSelf(std::ostream& os)
const
;
73
74
private
:
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
igtl::Socket
class IGTL_EXPORT Socket
Definition:
igtlSocket.h:61
igtlSocket.h
igtlNewMacro
#define igtlNewMacro(x)
Definition:
igtlMacro.h:431
igtl::ServerSocket::Superclass
Socket Superclass
Definition:
igtlServerSocket.h:46
igtl
The "igtl" namespace contains all OpenIGTLink classes. There are several nested namespaces within the...
Definition:
igtlBindMessage.h:25
IGTLCommon_EXPORT
#define IGTLCommon_EXPORT
Definition:
igtlWin32Header.h:151
igtl::ServerSocket::Pointer
SmartPointer< Self > Pointer
Definition:
igtlServerSocket.h:47
igtl::ServerSocket::Self
ServerSocket Self
Definition:
igtlServerSocket.h:45
igtlClientSocket.h
igtl::SmartPointer< Self >
igtlTypeMacro
#define igtlTypeMacro(thisClass, superclass)
Definition:
igtlMacro.h:486
igtl::ServerSocket::ConstPointer
SmartPointer< const Self > ConstPointer
Definition:
igtlServerSocket.h:48
igtl::ServerSocket
Definition:
igtlServerSocket.h:42
igtlWin32Header.h
Generated for OpenIGTLink by
Doxygen
1.8.17 written by
Dimitri van Heesch
, © 1997-2012