1 #ifndef RNPCOMMUNICATION_HH
2 #define RNPCOMMUNICATION_HH
38 #include <akglogging.hh>
39 #include <akg_exception.hh>
68 void init(CommBuffer *transmitterBuffer,
RnpBaseClientComm *newClientComm)
throw();
71 void processRequest()
throw();
75 CommBuffer* getAnswerBuffer()
throw();
78 bool isAnswerOk()
throw();
81 bool isInvalidFormat()
throw();
85 void clearAnswerBuffer()
throw();
88 bool validateMessage()
throw();
89 void executeOnWriteReady()
throw();
90 void specificCleanUpOnTimeout()
throw();
91 void executeOnReadError()
throw();
92 void executeOnWriteError()
throw();
95 void resetState()
throw();
132 void setConnectionParameters(
const char* serverHost,
int serverPort)
throw();
140 void jobIsReady()
throw();
143 void setMaxRetry(
unsigned int newMaxRetry);
146 unsigned int getMaxRetry();
160 bool sendRequestGetAnswer();
166 virtual bool checkForExceptions();
170 void reassembleAkgSerializable() throw(AkgSerializableException);
173 void reassembleStlException() throw(RnpStlException);
175 void clearAnswer() throw();
182 void initDefaultCommunication() throw();
187 CommBuffer transmitterBuffer;
191 NbCommunicator *communicatorPtr;
192 NbCommunicator internalCommunicator;
195 const
char* serverHost;
196 unsigned int serverPort;
197 unsigned int maxRetry;
200 void printCurrentParameter() throw();
223 void init(RnpBaseServerComm*)
throw();
226 void processRequest()
throw();
230 bool validateMessage()
throw();
231 void executeOnAccept()
throw();
232 void executeOnWriteReady()
throw();
233 void specificCleanUpOnTimeout()
throw();
234 void executeOnReadError()
throw();
235 void executeOnWriteError()
throw();
237 void resetJob()
throw();
271 bool setServerJobs(
int nrOfServerJobs)
throw();
274 int countServerJobs()
throw();
277 void connectToCommunicator(NbCommunicator&);
281 bool disconnectFromCommunicator()
throw();
284 void setTransmitterBufferSize(
int)
throw();
287 int getTransmitterBufferSize()
throw();
299 void communicatorShouldExit()
throw();
304 virtual void decodeFragment() = 0;
307 const char* getNextAsString(
RnpQuark parameterType)
const;
310 int getNextAsInteger(
RnpQuark parameterType)
const;
313 float getNextAsFloat(
RnpQuark parameterType)
const;
316 double getNextAsDouble(
RnpQuark parameterType)
const;
319 const void* getNextAsOpaque(
RnpQuark parameterType)
const;
322 int getCurrentParameterLength()
const throw();
324 void answerAkgSerializable(AkgSerializableException&)
throw();
327 void answerSTLException(exception&)
throw();
331 void answerUnknownError()
throw();
334 void discardFragment()
throw();
337 void startOkAnswer()
throw();
340 void endOkAnswer()
throw();
350 vector<RnpServerJob*> serverJob;
354 NbCommunicator *communicator;
356 int transmitterBufferSize;
Definition: rnpembedded.hh:155
RnpTransport::CarrierProtocol carrierProtocol
Definition: rnpcommunication.hh:151
int RnpQuark
The basic type used in RNP. It is always 32-bit long.
Definition: rnprotocol.hh:51
RnpTransmitter encoder
Definition: rnpcommunication.hh:343
Definition: rnpcommunication.hh:215
Definition: rnprotocol.hh:362
Definition: rnpembedded.hh:82
Definition: rnpcommunication.hh:260
RnpProtocolDecoder decoder
Definition: rnpcommunication.hh:342
RnpBaseServerComm * serverCommPtr
Definition: rnpcommunication.hh:239
RnpReceiver rnpReceiver
Definition: rnpcommunication.hh:241
Definition: rnpcommunication.hh:59
CommBuffer transmiterBuffer
Definition: rnpcommunication.hh:243
#define RNP_DEFAULTBUFFERSIZE
Definition: rnprotocol.hh:48
Definition: rnpembedded.hh:55
CarrierProtocol
Definition: rnpembedded.hh:52
RnpQuark serverType
Definition: rnpcommunication.hh:150
Definition: rnpcommunication.hh:117