Skip to content
Snippets Groups Projects
Commit 80d4f51b authored by Claudio Bisegni's avatar Claudio Bisegni
Browse files

added the print of exception on getNewSocketPair nad added new public api for...

added the print of exception on getNewSocketPair nad added new public api for send well format opcode in AbstractRemoteIODriver
parent c766b274
No related branches found
No related tags found
No related merge requests found
......@@ -41,7 +41,8 @@ socket_service(NULL){
ZMQDirectIOClientConnection::~ZMQDirectIOClientConnection() {}
void ZMQDirectIOClientConnection::init(void *init_data) throw(chaos::CException) {
if(ensureSocket() == false) throw CException(-1, "Error configuring socket", __PRETTY_FUNCTION__);
int err = 0;
if((err = ensureSocket())) throw CException(err, "Error configuring socket", __PRETTY_FUNCTION__);
}
void ZMQDirectIOClientConnection::deinit() throw(chaos::CException) {
......@@ -217,6 +218,8 @@ int ZMQDirectIOClientConnection::getNewSocketPair() {
}
} catch(chaos::CException& ex) {
releaseSocketPair();
err = ex.errorCode;
DECODE_CHAOS_EXCEPTION(ex);
}
return err;
}
......
......@@ -154,6 +154,26 @@ namespace chaos {
~AbstractRemoteIODriver(){}
//!Send raw request to the remote driver
/*!
\param message_data is the raw data to be transmitted to the remote driver
\param received_data si the raw data received from the driver
*/
int sendOpcodeRequest(const std::string opcode,
chaos::common::data::CDWUniquePtr message_data,
chaos::common::data::CDWShrdPtr& message_response,
uint32_t timeout = 5000) {
int err = 0;
LStringWriteLock wl = current_connection_identifier.getWriteLockObject();
if((err = _managePhases())) {
return err;
}
return _sendRawOpcodeRequest(opcode,
ChaosMoveOperator(message_data),
message_response,
timeout);
}
//!Send raw request to the remote driver
/*!
\param message_data is the raw data to be transmitted to the remote driver
......@@ -168,7 +188,8 @@ namespace chaos {
return err;
}
return _sendRawRequest(ChaosMoveOperator(message_data),
message_response);
message_response,
timeout);
}
//!Send raw message to the remote driver
......@@ -326,12 +347,14 @@ namespace chaos {
//send datapack as opcode format
int _sendRawOpcodeRequest(const std::string opcode,
chaos::common::data::CDWUniquePtr message_data,
chaos::common::data::CDWShrdPtr& message_response) {
chaos::common::data::CDWShrdPtr& message_response,
uint32_t timeout = 5000) {
chaos::common::data::CDWUniquePtr opcpde_msg(new chaos::common::data::CDataWrapper());
opcpde_msg->addStringValue(MESSAGE_OPCODE, opcode);
opcpde_msg->addCSDataValue(MESSAGE_OPCODE_PARAMETER, *message_data);
return _sendRawRequest(ChaosMoveOperator(opcpde_msg),
message_response);
message_response,
timeout);
}
int _sendRawRequest(chaos::common::data::CDWUniquePtr message_data,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment