39 #ifndef __vtkSocketCommunicator_h
40 #define __vtkSocketCommunicator_h
42 #include "vtkParallelCoreModule.h"
47 #ifdef VTK_WORDS_BIGENDIAN
48 # define vtkSwap4 vtkByteSwap::Swap4LE
49 # define vtkSwap4Range vtkByteSwap::Swap4LERange
50 # define vtkSwap8 vtkByteSwap::Swap8LE
51 # define vtkSwap8Range vtkByteSwap::Swap8LERange
53 # define vtkSwap4 vtkByteSwap::Swap4BE
54 # define vtkSwap4Range vtkByteSwap::Swap4BERange
55 # define vtkSwap8 vtkByteSwap::Swap8BE
56 # define vtkSwap8Range vtkByteSwap::Swap8BERange
72 virtual int WaitForConnection(
int port);
74 unsigned long msec = 0);
78 virtual void CloseConnection();
81 virtual int ConnectTo(
const char* hostName,
int port);
85 vtkGetMacro(SwapBytesInReceivedData,
int);
100 int remoteHandle,
int tag);
102 int remoteHandle,
int tag);
133 int operation,
int destProcessId);
136 Operation *operation,
int destProcessId);
148 vtkSetClampMacro(PerformHandshake,
int, 0, 1);
149 vtkBooleanMacro(PerformHandshake,
int);
150 vtkGetMacro(PerformHandshake,
int);
157 virtual void SetLogStream(ostream* stream);
158 virtual ostream* GetLogStream();
167 virtual int LogToFile(
const char*
name);
168 virtual int LogToFile(
const char*
name,
int append);
173 vtkSetMacro(ReportErrors,
int);
174 vtkGetMacro(ReportErrors,
int);
189 int ServerSideHandshake();
193 int ClientSideHandshake();
198 vtkGetMacro(IsServer,
int);
203 static int GetVersion();
212 void BufferCurrentMessage()
213 { this->BufferMessage =
true; }
217 bool HasBufferredMessages();
238 int SendTagged(
const void*
data,
int wordSize,
int numWords,
int tag,
239 const char* logName);
240 int ReceiveTagged(
void*
data,
int wordSize,
int numWords,
int tag,
241 const char* logName);
242 int ReceivePartialTagged(
void*
data,
int wordSize,
int numWords,
int tag,
243 const char* logName);
245 int ReceivedTaggedFromBuffer(
246 void*
data,
int wordSize,
int numWords,
int tag,
const char* logName);
249 void FixByteOrder(
void*
data,
int wordSize,
int numWords);
252 void LogTagged(
const char*
name,
const void*
data,
int wordSize,
int numWords,
253 int tag,
const char* logName);
254 int CheckForErrorInternal(
int id);
260 int SelectSocket(
int socket,
unsigned long msec);
272 int TagMessageLength;
275 class vtkMessageBuffer;
276 vtkMessageBuffer* ReceivedMessageBuffer;