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: Open IGT Link Library
4  Module: $HeadURL: http://svn.na-mic.org/NAMICSandBox/trunk/OpenIGTLink/Source/igtlServerSocket.h $
5  Language: C++
6  Date: $Date: 2010-06-09 16:16:36 -0400 (Wed, 09 Jun 2010) $
7  Version: $Revision: 6525 $
8 
9  Copyright (c) Insight Software Consortium. All rights reserved.
10 
11  This software is distributed WITHOUT ANY WARRANTY; without even
12  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
13  PURPOSE. See the above copyright notices for more information.
14 
15 =========================================================================*/
16 /*=========================================================================
17 
18  Program: Visualization Toolkit
19  Module: $RCSfile: vtkServerSocket.h,v $
20 
21  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
22  All rights reserved.
23  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
24 
25  This software is distributed WITHOUT ANY WARRANTY; without even
26  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
27  PURPOSE. See the above copyright notice for more information.
28 
29 =========================================================================*/
30 // .NAME igtlServerSocket - Encapsulate a socket that accepts connections.
31 // .SECTION Description
32 //
33 
34 #ifndef __igtlServerSocket_h
35 #define __igtlServerSocket_h
36 
37 #include "igtlSocket.h"
38 #include "igtlClientSocket.h"
39 #include "igtlWin32Header.h"
40 
41 namespace igtl
42 {
43 
45 {
46 public:
47  typedef ServerSocket Self;
48  typedef Socket Superclass;
51 
54 
55  // Description:
56  // Creates a server socket at a given port and binds to it.
57  // Returns -1 on error. 0 on success.
58  int CreateServer(int port);
59 
60  // Description:
61  // Waits for a connection. When a connection is received
62  // a new ClientSocket object is created and returned.
63  // Returns NULL on timeout.
64  //ClientSocket* WaitForConnection(unsigned long msec=0);
65  ClientSocket::Pointer WaitForConnection(unsigned long msec=0);
66 
67  // Description:
68  // Returns the port on which the server is running.
69  int GetServerPort();
70 protected:
71  ServerSocket();
72  ~ServerSocket();
73 
74  void PrintSelf(std::ostream& os) const;
75 
76 private:
77  ServerSocket(const ServerSocket&); // Not implemented.
78  void operator=(const ServerSocket&); // Not implemented.
79 };
80 
81 } // end of igtl namespace
82 
83 
84 #endif
85 
86 

Generated at Thu Mar 20 2014 16:32:06 for OpenIGTLink by doxygen 1.8.1.2 written by Dimitri van Heesch, © 1997-2000