Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-UDR
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenXG
OpenXG-UDR
Commits
2e5f9836
Commit
2e5f9836
authored
Jun 24, 2021
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix issue for starting Pistache server
parent
c0fb2a5b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
8 deletions
+12
-8
src/oai_udr/main.cpp
src/oai_udr/main.cpp
+12
-8
No files found.
src/oai_udr/main.cpp
View file @
2e5f9836
...
@@ -36,7 +36,7 @@ using namespace std;
...
@@ -36,7 +36,7 @@ using namespace std;
using
namespace
config
;
using
namespace
config
;
udr_config
udr_cfg
;
udr_config
udr_cfg
;
udr_app
*
udr_app_inst
=
nullptr
;
udr_app
*
udr_app_inst
=
nullptr
;
UDRApiServer
*
api_server
=
nullptr
;
UDRApiServer
*
api_server
=
nullptr
;
#include "udr_config.hpp"
#include "udr_config.hpp"
...
@@ -94,23 +94,27 @@ int main(int argc, char** argv) {
...
@@ -94,23 +94,27 @@ int main(int argc, char** argv) {
// Currently hard-coded value. TODO: add as config option.
// Currently hard-coded value. TODO: add as config option.
string
pid_file_name
=
get_exe_absolute_path
(
"/var/run"
,
udr_cfg
.
instance
);
string
pid_file_name
=
get_exe_absolute_path
(
"/var/run"
,
udr_cfg
.
instance
);
if
(
!
is_pid_file_lock_success
(
pid_file_name
.
c_str
()))
{
if
(
!
is_pid_file_lock_success
(
pid_file_name
.
c_str
()))
{
Logger
::
udr_server
().
error
(
Logger
::
udr_server
().
error
(
"Lock PID file %s failed
\n
"
,
"Lock PID file %s failed
\n
"
,
pid_file_name
.
c_str
());
pid_file_name
.
c_str
());
exit
(
-
EDEADLK
);
exit
(
-
EDEADLK
);
}
}
// UDR Pistache API server (HTTP1)
// UDR Pistache API server (HTTP1)
Pistache
::
Address
addr
(
/* Pistache::Address addr(
std
::
string
(
inet_ntoa
(
*
((
struct
in_addr
*
)
&
udr_cfg
.
nudr
.
addr4
))),
std::string(inet_ntoa(*((struct in_addr*) &udr_cfg.nudr.addr4))),
Pistache
::
Port
(
udr_cfg
.
nudr
.
port
));
Pistache::Port(udr_cfg.nudr.port));
*/
// TODO: to be updated
Pistache
::
Address
addr
(
udr_cfg
.
nudr
.
addr4
,
Pistache
::
Port
(
udr_cfg
.
nudr
.
port
));
api_server
=
new
UDRApiServer
(
addr
,
udr_app_inst
);
api_server
=
new
UDRApiServer
(
addr
,
udr_app_inst
);
api_server
->
init
(
2
);
api_server
->
init
(
2
);
std
::
thread
udr_manager
(
&
UDRApiServer
::
start
,
api_server
);
std
::
thread
udr_manager
(
&
UDRApiServer
::
start
,
api_server
);
udr_manager
.
join
();
udr_manager
.
join
();
FILE
*
fp
=
NULL
;
FILE
*
fp
=
NULL
;
std
::
string
filename
=
fmt
::
format
(
"/tmp/udr_{}.status"
,
getpid
());
std
::
string
filename
=
fmt
::
format
(
"/tmp/udr_{}.status"
,
getpid
());
fp
=
fopen
(
filename
.
c_str
(),
"w+"
);
fp
=
fopen
(
filename
.
c_str
(),
"w+"
);
fprintf
(
fp
,
"STARTED
\n
"
);
fprintf
(
fp
,
"STARTED
\n
"
);
fflush
(
fp
);
fflush
(
fp
);
fclose
(
fp
);
fclose
(
fp
);
...
...
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