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
6f537ff7
Unverified
Commit
6f537ff7
authored
4 years ago
by
kladko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug/SKALE-3751-enable-zeromq
parent
f0baecee
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
5 deletions
+12
-5
ZMQServer.cpp
ZMQServer.cpp
+9
-2
ZMQServer.h
ZMQServer.h
+3
-3
No files found.
ZMQServer.cpp
View file @
6f537ff7
...
...
@@ -43,6 +43,13 @@ ZMQServer::ZMQServer(bool _checkSignature, const string& _caCertFile)
frontend_
(
*
ctx_
,
ZMQ_ROUTER
),
backend_
(
*
ctx_
,
ZMQ_DEALER
)
{
workerThreads
=
2
*
thread
::
hardware_concurrency
();
if
(
workerThreads
==
0
)
{
workerThreads
=
8
;
}
if
(
_checkSignature
)
{
CHECK_STATE
(
!
_caCertFile
.
empty
());
ifstream
t
(
_caCertFile
);
...
...
@@ -81,10 +88,10 @@ void ZMQServer::run() {
}
spdlog
::
info
(
"Creating {} zmq server workers ..."
,
kMaxThread
);
spdlog
::
info
(
"Creating {} zmq server workers ..."
,
workerThreads
);
try
{
for
(
int
i
=
0
;
i
<
kMaxThread
;
++
i
)
{
for
(
int
i
=
0
;
i
<
workerThreads
;
++
i
)
{
workers
.
push_back
(
make_shared
<
ServerWorker
>
(
*
ctx_
,
ZMQ_DEALER
,
this
->
checkSignature
,
this
->
caCert
));
auto
th
=
make_shared
<
std
::
thread
>
(
std
::
bind
(
&
ServerWorker
::
work
,
workers
[
i
]));
...
...
This diff is collapsed.
Click to expand it.
ZMQServer.h
View file @
6f537ff7
...
...
@@ -42,6 +42,9 @@ using namespace std;
class
ZMQServer
{
uint64_t
workerThreads
;
public
:
bool
checkSignature
=
false
;
...
...
@@ -54,9 +57,6 @@ public:
ZMQServer
(
bool
_checkSignature
,
const
string
&
_caCertFile
);
enum
{
kMaxThread
=
1
};
void
run
();
...
...
This diff is collapsed.
Click to expand it.
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