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 
39 namespace igtl
40 {
41 
43 {
44 public:
45  typedef ServerSocket Self;
46  typedef Socket Superclass;
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);
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 
SmartPointer< const Self > ConstPointer
#define igtlTypeMacro(thisClass, superclass)
Definition: igtlMacro.h:486
SmartPointer< Self > Pointer
The "igtl" namespace contains all OpenIGTLink classes. There are several nested namespaces within the...
#define IGTLCommon_EXPORT
class IGTL_EXPORT Socket
Definition: igtlSocket.h:61
#define igtlNewMacro(x)
Definition: igtlMacro.h:431

Generated at Mon Dec 23 2019 00:49:23 for OpenIGTLink by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2012