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
75ee6f0d
Unverified
Commit
75ee6f0d
authored
Mar 31, 2021
by
Oleh Nikolaiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SKALE-4005 check for exit
parent
aef2a84f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
1 deletion
+17
-1
SGXRegistrationServer.cpp
SGXRegistrationServer.cpp
+15
-0
SGXRegistrationServer.h
SGXRegistrationServer.h
+2
-1
No files found.
SGXRegistrationServer.cpp
View file @
75ee6f0d
...
@@ -32,6 +32,7 @@
...
@@ -32,6 +32,7 @@
#include "sgxwallet_common.h"
#include "sgxwallet_common.h"
#include "ExitHandler.h"
#include "SGXException.h"
#include "SGXException.h"
#include "LevelDB.h"
#include "LevelDB.h"
...
@@ -172,6 +173,7 @@ int SGXRegistrationServer::initRegistrationServer(bool _autoSign) {
...
@@ -172,6 +173,7 @@ int SGXRegistrationServer::initRegistrationServer(bool _autoSign) {
if
(
!
server
->
StartListening
())
{
if
(
!
server
->
StartListening
())
{
spdlog
::
error
(
"Registration server could not start listening on port {}"
,
BASE_PORT
+
1
);
spdlog
::
error
(
"Registration server could not start listening on port {}"
,
BASE_PORT
+
1
);
ExitHandler
::
exitHandler
(
SIGTERM
,
ExitHandler
::
ec_failure
);
exit
(
-
10
);
exit
(
-
10
);
}
else
{
}
else
{
spdlog
::
info
(
"Registration server started on port {}"
,
BASE_PORT
+
1
);
spdlog
::
info
(
"Registration server started on port {}"
,
BASE_PORT
+
1
);
...
@@ -180,6 +182,19 @@ int SGXRegistrationServer::initRegistrationServer(bool _autoSign) {
...
@@ -180,6 +182,19 @@ int SGXRegistrationServer::initRegistrationServer(bool _autoSign) {
return
0
;
return
0
;
}
}
int
SGXRegistrationServer
::
exitServer
()
{
spdlog
::
info
(
"Stoping registration server"
);
if
(
!
server
->
StopListening
())
{
spdlog
::
error
(
"Registration server could not be stopped"
);
exit
(
-
102
);
}
else
{
spdlog
::
info
(
"Registration server stopped"
);
}
return
0
;
}
shared_ptr
<
SGXRegistrationServer
>
SGXRegistrationServer
::
getServer
()
{
shared_ptr
<
SGXRegistrationServer
>
SGXRegistrationServer
::
getServer
()
{
CHECK_STATE
(
server
);
CHECK_STATE
(
server
);
...
...
SGXRegistrationServer.h
View file @
75ee6f0d
...
@@ -62,7 +62,8 @@ public:
...
@@ -62,7 +62,8 @@ public:
static
int
initRegistrationServer
(
bool
_autoSign
=
false
);
static
int
initRegistrationServer
(
bool
_autoSign
=
false
);
static
int
exitServer
();
};
};
#endif // SGXD_SGXREGISTRATIONSERVER_H
#endif // SGXD_SGXREGISTRATIONSERVER_H
\ 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