40 #ifndef __igtlSocket_h
41 #define __igtlSocket_h
49 #if defined(_WIN32) && !defined(__CYGWIN__)
58 class SocketCollection;
75 int GetConnected() {
return (this->m_SocketDescriptor >=0); }
79 this->CloseSocket(this->m_SocketDescriptor);
80 this->m_SocketDescriptor = -1;
85 int Send(
const void* data,
int length);
93 int Receive(
void* data,
int length,
int readFully=1);
97 int SetTimeout(
int timeout);
101 int SetReceiveTimeout(
int timeout);
105 int SetSendTimeout(
int timeout);
109 int SetReceiveBlocking(
int sw);
113 int SetSendBlocking(
int sw);
116 int GetSocketAddressAndPort(std::string& address,
int & port);
122 int Skip(
int length,
int skipFully=1);
128 void PrintSelf(std::ostream& os)
const;
134 friend class vtkSocketCollection;
142 void CloseSocket(
int socketdescriptor);
146 int BindSocket(
int socketdescriptor,
int port);
151 int SelectSocket(
int socketdescriptor,
unsigned long msec);
155 int Accept(
int socketdescriptor);
158 int Listen(
int socketdescriptor);
161 int Connect(
int socketdescriptor,
const char* hostname,
int port);
165 int GetPort(
int socketdescriptor);
170 static int SelectSockets(
const int* sockets_to_select,
int size,
171 unsigned long msec,
int* selected_index);
175 void operator=(
const Socket&);
177 #if defined(_WIN32) && !defined(__CYGWIN__)
179 DWORD m_ReceiveTimeout;
180 DWORD m_OrigSendTimeout;
181 DWORD m_OrigReceiveTimeout;
183 struct timeval m_SendTimeout;
184 struct timeval m_ReceiveTimeout;
185 struct timeval m_OrigSendTimeout;
186 struct timeval m_OrigReceiveTimeout;
188 int m_SendTimeoutFlag;
189 int m_ReceiveTimeoutFlag;
#define igtlGetMacro(name, type)
#define igtlTypeMacro(thisClass, superclass)
SmartPointer< const Self > ConstPointer
The "igtl" namespace contains all OpenIGTLink classes. There are several nested namespaces within the...
void CloseSocket()
Close the socket.
SmartPointer< Self > Pointer
Base class for most igtl classes.