Unverified Commit b0d5ac3e authored by kladko's avatar kladko

bug/SKALE-3751-enable-zeromq

parent 3a73a043
...@@ -52,25 +52,19 @@ shared_ptr <ZMQMessage> ZMQClient::doRequestReply(Json::Value &_req) { ...@@ -52,25 +52,19 @@ shared_ptr <ZMQMessage> ZMQClient::doRequestReply(Json::Value &_req) {
CHECK_STATE(resultStr.back() == '}') CHECK_STATE(resultStr.back() == '}')
return ZMQMessage::parse(resultStr.c_str(), resultStr.size(), false); return ZMQMessage::parse(resultStr.c_str(), resultStr.size(), false);
} catch (std::exception & e) { } catch (std::exception &e) {
spdlog::error(string("Error in doRequestReply:") + e.what());
cerr << "Error:" << e.what() << endl;
sleep(10);
throw; throw;
} catch (...) { } catch (...) {
cerr << "Error!" << endl; spdlog::error("Error in doRequestReply");
sleep(10);
throw; throw;
} }
} }
string ZMQClient::doZmqRequestReply(string &_req) { string ZMQClient::doZmqRequestReply(string &_req) {
stringstream request; stringstream request;
...@@ -86,7 +80,7 @@ string ZMQClient::doZmqRequestReply(string &_req) { ...@@ -86,7 +80,7 @@ string ZMQClient::doZmqRequestReply(string &_req) {
} }
CHECK_STATE(clientSocket); CHECK_STATE(clientSocket);
spdlog::debug("ZMQ client sending: \n {}" , _req); spdlog::debug("ZMQ client sending: \n {}", _req);
s_send(*clientSocket, _req); s_send(*clientSocket, _req);
...@@ -116,8 +110,8 @@ string ZMQClient::doZmqRequestReply(string &_req) { ...@@ -116,8 +110,8 @@ string ZMQClient::doZmqRequestReply(string &_req) {
} }
ZMQClient::ZMQClient(const string &ip, uint16_t port, bool _sign, const string& _certFileName, ZMQClient::ZMQClient(const string &ip, uint16_t port, bool _sign, const string &_certFileName,
const string& _certKeyName) : ctx(1) { const string &_certKeyName) : ctx(1) {
if (_sign) { if (_sign) {
CHECK_STATE(!_certFileName.empty()); CHECK_STATE(!_certFileName.empty());
...@@ -136,7 +130,7 @@ ZMQClient::ZMQClient(const string &ip, uint16_t port, bool _sign, const string& ...@@ -136,7 +130,7 @@ ZMQClient::ZMQClient(const string &ip, uint16_t port, bool _sign, const string&
void ZMQClient::reconnect() { void ZMQClient::reconnect() {
lock_guard<recursive_mutex> lock(mutex); lock_guard <recursive_mutex> lock(mutex);
auto pid = getProcessID(); auto pid = getProcessID();
...@@ -184,7 +178,6 @@ string ZMQClient::ecdsaSignMessageHash(int base, const std::string &keyName, con ...@@ -184,7 +178,6 @@ string ZMQClient::ecdsaSignMessageHash(int base, const std::string &keyName, con
} }
uint64_t ZMQClient::getProcessID() { uint64_t ZMQClient::getProcessID() {
return syscall(__NR_gettid); return syscall(__NR_gettid);
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment