49#if defined(_WIN32) && !defined(__CYGWIN__)
58class SocketCollection;
79 this->CloseSocket(this->m_SocketDescriptor);
80 this->m_SocketDescriptor = -1;
87 int Send(
const void* data,
int length);
95 int Receive(
void* data,
int length,
int readFully=1);
124 int Skip(
int length,
int skipFully=1);
136 friend class vtkSocketCollection;
163 int Connect(
int socketdescriptor,
const char* hostname,
int port);
173 unsigned long msec,
int* selected_index);
177 void operator=(
const Socket&);
179#if defined(_WIN32) && !defined(__CYGWIN__)
181 DWORD m_ReceiveTimeout;
182 DWORD m_OrigSendTimeout;
183 DWORD m_OrigReceiveTimeout;
185 struct timeval m_SendTimeout;
186 struct timeval m_ReceiveTimeout;
187 struct timeval m_OrigSendTimeout;
188 struct timeval m_OrigReceiveTimeout;
190 int m_SendTimeoutFlag;
191 int m_ReceiveTimeoutFlag;
Base class for most igtl classes.
Implements transparent reference counting.
SmartPointer< const Self > ConstPointer
int Listen(int socketdescriptor)
Listen for connections on a socket. Returns 0 on success. -1 on error.
int GetPort(int socketdescriptor)
void CloseSocket(int socketdescriptor)
Close the socket.
int SetSendTimeout(int timeout)
int Send(const void *data, int length)
static int SelectSockets(const int *sockets_to_select, int size, unsigned long msec, int *selected_index)
int Connect(int socketdescriptor, const char *hostname, int port)
Connect to a server socket. Returns 0 on success, -1 on error.
int Accept(int socketdescriptor)
int GetConnected()
Check is the socket is alive.
int BindSocket(int socketdescriptor, int port)
int GetSocketAddressAndPort(std::string &address, int &port)
Get socket address.
SmartPointer< Self > Pointer
void CloseSocket()
Close the socket.
void PrintSelf(std::ostream &os) const
int SetReceiveTimeout(int timeout)
int Receive(void *data, int length, int readFully=1)
int SetReceiveBlocking(int sw)
igtlGetMacro(SocketDescriptor, int)
int SetTimeout(int timeout)
int Skip(int length, int skipFully=1)
int SetSendBlocking(int sw)
int SelectSocket(int socketdescriptor, unsigned long msec)
#define igtlTypeMacro(thisClass, superclass)
The "igtl" namespace contains all OpenIGTLink classes. There are several nested namespaces within the...