Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
sgxwallet
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
董子豪
sgxwallet
Commits
b0d5ac3e
Unverified
Commit
b0d5ac3e
authored
Jan 28, 2021
by
kladko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug/SKALE-3751-enable-zeromq
parent
3a73a043
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
20 deletions
+13
-20
ZMQClient.cpp
ZMQClient.cpp
+13
-20
No files found.
ZMQClient.cpp
View file @
b0d5ac3e
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment