rasdaman complete source
|
#include <rnpcommunication.hh>
Public Member Functions | |
RnpBaseClientComm (RnpQuark serverType, RnpTransport::CarrierProtocol=RnpTransport::crp_Rnp) throw () | |
Constructor taking the server type and the carrier protocol. More... | |
RnpBaseClientComm (const char *serverHost, int serverPort, RnpQuark serverType, RnpTransport::CarrierProtocol=RnpTransport::crp_Rnp) throw () | |
virtual | ~RnpBaseClientComm () throw () |
Destructor. More... | |
void | setConnectionParameters (const char *serverHost, int serverPort) throw () |
void | setCarrierProtocol (RnpTransport::CarrierProtocol) throw () |
Set the carrier protocol. More... | |
RnpTransport::CarrierProtocol | getCarrierProtocol () throw () |
Returns the used carrier protocol. More... | |
void | jobIsReady () throw () |
void | setMaxRetry (unsigned int newMaxRetry) |
unsigned int | getMaxRetry () |
Returns the maximal retry count. More... | |
Protected Member Functions | |
void | startRequest (RnpQuark command, int transmitterBufferSize=RNP_DEFAULTBUFFERSIZE) |
Start building the request, might throw whatever new throws. More... | |
bool | sendRequestGetAnswer () |
virtual bool | checkForExceptions () |
void | reassembleAkgSerializable () throw (AkgSerializableException) |
void | reassembleStlException () throw (RnpStlException) |
void | clearAnswer () throw () |
Clear the answer when you don't need it any more, memory is released. More... | |
void | initDefaultCommunication () throw () |
void | printCurrentParameter () throw () |
Helper function for ptinting the current parameter. More... | |
Protected Attributes | |
RnpQuark | serverType |
RnpTransport::CarrierProtocol | carrierProtocol |
RnpProtocolDecoder | decoder |
RnpTransmitter | encoder |
CommBuffer | transmitterBuffer |
RnpClientJob | clientJob |
NbCommunicator * | communicatorPtr |
NbCommunicator | internalCommunicator |
const char * | serverHost |
unsigned int | serverPort |
unsigned int | maxRetry |
RnpBaseClientComm is the base class for the client communication. It offers the necessary elements for creating the request, send it, receive the answer and decode it. Every specific client comm will inherit from this and will implement the various functions using the functions provided by this class.
It has a private NbCommunicator object, but if you need a shared one be my guest. The RnpClientJob is its own also and this stays like that!
rnp::RnpBaseClientComm::RnpBaseClientComm | ( | RnpQuark | serverType, |
RnpTransport::CarrierProtocol | = RnpTransport::crp_Rnp |
||
) | |||
throw | ( | ||
) |
Constructor taking the server type and the carrier protocol.
rnp::RnpBaseClientComm::RnpBaseClientComm | ( | const char * | serverHost, |
int | serverPort, | ||
RnpQuark | serverType, | ||
RnpTransport::CarrierProtocol | = RnpTransport::crp_Rnp |
||
) | |||
throw | ( | ||
) |
Constructor taking also the connection info for the server Assert: serverHost != 0, serverPort > 0
|
virtual |
Destructor.
|
protectedvirtual |
detects an exception as answer and throws it. this version only Akg and STL returns true if there is an exception, but can't reassemble it returns false if there is a correct answer, no exception doesn't return, but throws, if there is an exception and it can reassemble it
|
protected |
Clear the answer when you don't need it any more, memory is released.
RnpTransport::CarrierProtocol rnp::RnpBaseClientComm::getCarrierProtocol | ( | ) | ||
throw | ( | |||
) |
Returns the used carrier protocol.
unsigned int rnp::RnpBaseClientComm::getMaxRetry | ( | ) |
Returns the maximal retry count.
|
protected |
Default communication init, build another init() if you don't like this This sets 1 job, 60sec as timeout, attaches the internal job. Be aware that this timeout is not the timeout of the client job, but the one of the communicator
void rnp::RnpBaseClientComm::jobIsReady | ( | ) | ||
throw | ( | |||
) |
|
protected |
Helper function for ptinting the current parameter.
|
protected |
|
protected |
|
protected |
Does the dirty work: sends the request and brings the answer Later it will throw various exceptions, but for now it only returns 'true' if everything is OK Assert: serverHost != 0, serverPort > 0
void rnp::RnpBaseClientComm::setCarrierProtocol | ( | RnpTransport::CarrierProtocol | ) | ||
throw | ( | ||||
) |
Set the carrier protocol.
void rnp::RnpBaseClientComm::setConnectionParameters | ( | const char * | serverHost, |
int | serverPort | ||
) | |||
throw | ( | ||
) |
Set the connection parameter Assert: serverHost != 0, serverPort > 0
void rnp::RnpBaseClientComm::setMaxRetry | ( | unsigned int | newMaxRetry | ) |
|
protected |
Start building the request, might throw whatever new throws.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |