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
83888e7d
Unverified
Commit
83888e7d
authored
Jan 15, 2021
by
kladko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug/SKALE-3662 Adding libzmq
parent
10d80482
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
4 deletions
+11
-4
ServerWorker.cpp
ServerWorker.cpp
+9
-1
ZMQClient.cpp
ZMQClient.cpp
+1
-1
ZMQClient.h
ZMQClient.h
+1
-1
ZMQMessage.cpp
ZMQMessage.cpp
+0
-1
No files found.
ServerWorker.cpp
View file @
83888e7d
...
...
@@ -34,9 +34,17 @@ void ServerWorker::work() {
zmq
::
message_t
msg
;
worker_
.
recv
(
&
msg
);
vector
<
uint8_t
>
msgData
(
msg
.
size
()
+
1
,
0
);
memcpy
(
msgData
.
data
(),
msg
.
data
(),
msg
.
size
());
if
(
msg
.
size
()
<
5
||
msgData
.
at
(
0
)
!=
'{'
||
msgData
[
msg
.
size
()]
!=
'}'
)
{
cerr
<<
"haha"
;
continue
;
}
cerr
<<
"Received:"
<<
msgData
.
data
();
sleep
(
1
);
auto
parsedMsg
=
ZMQMessage
::
parse
(
(
const
char
*
)
msgData
.
data
(),
msg
.
size
(),
true
);
...
...
ZMQClient.cpp
View file @
83888e7d
...
...
@@ -80,7 +80,7 @@ ZMQClient::ZMQClient(string &ip, uint16_t port) : ctx(1) {
void
ZMQClient
::
reconnect
()
{
clientSocket
=
nullptr
;
// delete previous
clientSocket
=
make_unique
<
zmq
::
socket_t
>
(
ctx
,
ZMQ_
REQ
);
clientSocket
=
make_unique
<
zmq
::
socket_t
>
(
ctx
,
ZMQ_
DEALER
);
clientSocket
->
connect
(
url
);
// Configure socket to not wait at close time
int
linger
=
0
;
...
...
ZMQClient.h
View file @
83888e7d
...
...
@@ -35,7 +35,7 @@
#include "ZMQMessage.h"
#define REQUEST_TIMEOUT
25
00 // msecs, (> 1000!)
#define REQUEST_TIMEOUT
100
00 // msecs, (> 1000!)
class
ZMQClient
{
...
...
ZMQMessage.cpp
View file @
83888e7d
...
...
@@ -52,7 +52,6 @@ shared_ptr <ZMQMessage> ZMQMessage::parse(const char* _msg,
size_t
_size
,
bool
_isRequest
)
{
cerr
<<
"Server got:"
<<
_msg
<<
endl
;
CHECK_STATE
(
_msg
);
CHECK_STATE
(
_size
>
5
);
...
...
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