VTK
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
dox
Common
vtkSocket.h
Go to the documentation of this file.
1
/*=========================================================================
2
3
Program: Visualization Toolkit
4
Module: vtkSocket.h
5
6
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7
All rights reserved.
8
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10
This software is distributed WITHOUT ANY WARRANTY; without even
11
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12
PURPOSE. See the above copyright notice for more information.
13
14
=========================================================================*/
22
#ifndef __vtkSocket_h
23
#define __vtkSocket_h
24
25
#include "
vtkObject.h
"
26
27
class
vtkSocketCollection
;
28
class
VTK_COMMON_EXPORT
vtkSocket
:
public
vtkObject
29
{
30
public
:
31
vtkTypeMacro(
vtkSocket
,
vtkObject
);
32
void
PrintSelf
(ostream& os,
vtkIndent
indent);
33
34
// ----- Status API ----
36
int
GetConnected
() {
return
(this->SocketDescriptor >=0); }
37
39
void
CloseSocket();
40
41
// ------ Communication API ---
44
int
Send(
const
void
*
data
,
int
length
);
45
51
int
Receive(
void
*
data
,
int
length
,
int
readFully=1);
52
54
56
vtkGetMacro(SocketDescriptor,
int
);
58
60
62
static
int
SelectSockets(
const
int
* sockets_to_select,
int
size
,
63
unsigned
long
msec,
int
* selected_index);
64
protected
:
65
vtkSocket
();
66
~
vtkSocket
();
68
69
int
SocketDescriptor
;
70
71
//BTX
72
friend
class
vtkSocketCollection
;
73
//ETX
74
77
int
CreateSocket();
78
80
void
CloseSocket(
int
socketdescriptor);
81
84
int
BindSocket(
int
socketdescriptor,
int
port
);
85
88
int
SelectSocket(
int
socketdescriptor,
unsigned
long
msec);
89
92
int
Accept(
int
socketdescriptor);
93
96
int
Listen(
int
socketdescriptor);
97
99
int
Connect(
int
socketdescriptor,
const
char
* hostname,
int
port
);
100
102
int
GetPort(
int
socketdescriptor);
103
104
private
:
105
vtkSocket
(
const
vtkSocket
&);
// Not implemented.
106
void
operator=(
const
vtkSocket
&);
// Not implemented.
107
};
108
109
110
#endif
111
Generated on Wed Nov 21 2012 21:33:40 for VTK by
1.8.2