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
832ff75a
Unverified
Commit
832ff75a
authored
Sep 09, 2021
by
kladko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SKALE-4586 Added Thread Pool
parent
fbdd91ac
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
3 deletions
+9
-3
ZMQServer.cpp
zmq_src/ZMQServer.cpp
+6
-2
ZMQServer.h
zmq_src/ZMQServer.h
+3
-1
No files found.
zmq_src/ZMQServer.cpp
View file @
832ff75a
...
...
@@ -175,7 +175,9 @@ void ZMQServer::checkForExit() {
}
}
void
ZMQServer
::
poll
()
{
PollResult
ZMQServer
::
poll
()
{
zmq_pollitem_t
items
[
1
];
items
[
0
].
socket
=
*
socket
;
items
[
0
].
events
=
ZMQ_POLLIN
;
...
...
@@ -184,8 +186,10 @@ void ZMQServer::poll() {
do
{
checkForExit
();
pollResult
=
zmq_poll
(
items
,
1
,
1
000
);
pollResult
=
zmq_poll
(
items
,
1
,
1
);
}
while
(
pollResult
==
0
);
return
GOT_INCOMING_MSG
;
}
string
ZMQServer
::
receiveMessage
(
zmq
::
message_t
&
_identity
)
{
...
...
zmq_src/ZMQServer.h
View file @
832ff75a
...
...
@@ -31,6 +31,8 @@
#include "Agent.h"
#include "WorkerThreadPool.h"
typedef
enum
{
GOT_INCOMING_MSG
=
0
,
GOT_OUTFOING_MSG
=
1
}
PollResult
;
class
ZMQServer
:
public
Agent
{
uint64_t
workerThreads
;
...
...
@@ -75,7 +77,7 @@ public:
void
checkForExit
();
void
poll
();
PollResult
poll
();
string
receiveMessage
(
zmq
::
message_t
&
_identity
);
...
...
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