forked from openigtlink/MatlabIGTL
-
Notifications
You must be signed in to change notification settings - Fork 0
/
igtlMexClientSocket.h
88 lines (61 loc) · 2.52 KB
/
igtlMexClientSocket.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
/*=========================================================================
Program: Open IGT Link Library
Module: $RCSfile: $
Language: C++
Date: $Date: $
Version: $Revision: $
Copyright (c) Insight Software Consortium. All rights reserved.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
/*=========================================================================
Program: Visualization Toolkit
Module: $RCSfile: vtkClientSocket.h,v $
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
// .NAME igtlClientSocket - Encapsulates a client socket.
/*=========================================================================
igtlMexClientSocket class
This is a modified version of igtlClientSocket class; the difference
from original igtlClientSocket is that it allows to get and set socket
descrptor. This allows opening, sending/receiving and closing socket
in different MEX files.
=========================================================================*/
#ifndef __igtlMexClientSocket_h
#define __igtlMexClientSocket_h
#include "igtlMexSocket.h"
#include "igtlWin32Header.h"
namespace igtl
{
class ServerSocket;
class IGTLCommon_EXPORT MexClientSocket : public MexSocket
{
public:
// typedef MexClientSocket Self;
// typedef MexSocket Superclass;
// typedef SmartPointer<Self> Pointer;
// typedef SmartPointer<const Self> ConstPointer;
igtlTypeMacro(igtl::MexClientSocket, igtl::MexSocket)
igtlNewMacro(igtl::MexClientSocket);
void PrintSelf(std::ostream& os);
// Description:
// Connects to host. Returns 0 on success, -1 on error.
int ConnectToServer(const char* hostname, int port);
protected:
MexClientSocket();
~MexClientSocket();
//BTX
friend class MexServerSocket;
//ETX
private:
MexClientSocket(const MexClientSocket&); // Not implemented.
void operator=(const MexClientSocket&); // Not implemented.
};
}
#endif