Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Cameo
cameo
Commits
5b6d5c01
Commit
5b6d5c01
authored
Oct 26, 2020
by
legoc
Browse files
(split) Removed port member from services classes
parent
8853fa53
Changes
6
Hide whitespace changes
Inline
Side-by-side
include/Server.h
View file @
5b6d5c01
...
...
@@ -58,7 +58,6 @@ public:
const
Endpoint
&
getEndpoint
()
const
;
const
std
::
string
&
getUrl
()
const
;
std
::
array
<
int
,
3
>
getVersion
()
const
;
int
getPort
()
const
;
bool
isAvailable
(
int
timeoutMs
)
const
;
/**
...
...
include/Services.h
View file @
5b6d5c01
...
...
@@ -45,7 +45,6 @@ public:
const
Endpoint
&
getEndpoint
()
const
;
const
std
::
string
&
getUrl
()
const
;
std
::
array
<
int
,
3
>
getVersion
()
const
;
int
getPort
()
const
;
const
std
::
string
&
getStatusEndpoint
()
const
;
bool
isAvailable
(
int
timeout
)
const
;
...
...
@@ -60,7 +59,6 @@ public:
Endpoint
m_serverEndpoint
;
std
::
array
<
int
,
3
>
m_serverVersion
;
std
::
string
m_url
;
int
m_port
;
int
m_statusPort
;
std
::
string
m_serverStatusEndpoint
;
std
::
unique_ptr
<
ServicesImpl
>
m_impl
;
...
...
src/Application.cpp
View file @
5b6d5c01
...
...
@@ -179,7 +179,6 @@ void This::initApplication(int argc, char *argv[]) {
m_serverEndpoint
=
Endpoint
::
parse
(
infoObject
[
message
::
ApplicationIdentity
::
SERVER
].
GetString
());
m_url
=
m_serverEndpoint
.
getProtocol
()
+
"://"
+
m_serverEndpoint
.
getAddress
();
m_port
=
m_serverEndpoint
.
getPort
();
// Create the request socket. The server endpoint has been defined.
Services
::
initRequestSocket
();
...
...
@@ -250,8 +249,7 @@ void This::initApplication(int argc, char *argv[]) {
m_com
=
unique_ptr
<
Com
>
(
new
Com
(
m_server
.
get
(),
m_id
));
cout
<<
"url = "
<<
m_url
<<
endl
;
cout
<<
"port = "
<<
m_port
<<
endl
;
cout
<<
"endpoint = "
<<
m_serverEndpoint
.
toString
()
<<
endl
;
cout
<<
"name = "
<<
m_name
<<
endl
;
cout
<<
"id = "
<<
m_id
<<
endl
;
cout
<<
"starterEndpoint = "
<<
m_starterEndpoint
<<
endl
;
...
...
src/Server.cpp
View file @
5b6d5c01
...
...
@@ -38,7 +38,6 @@ void Server::initServer(const Endpoint& endpoint, int timeoutMs) {
m_serverEndpoint
=
endpoint
;
m_url
=
endpoint
.
getProtocol
()
+
"://"
+
endpoint
.
getAddress
();
m_port
=
endpoint
.
getPort
();
// Set the timeout.
Services
::
setTimeout
(
timeoutMs
);
...
...
@@ -109,10 +108,6 @@ std::array<int, 3> Server::getVersion() const {
return
Services
::
getVersion
();
}
int
Server
::
getPort
()
const
{
return
Services
::
getPort
();
}
bool
Server
::
isAvailable
(
int
timeout
)
const
{
return
Services
::
isAvailable
(
timeout
);
}
...
...
src/Services.cpp
View file @
5b6d5c01
...
...
@@ -30,7 +30,6 @@ using namespace std;
namespace
cameo
{
Services
::
Services
()
:
m_port
(
0
),
m_statusPort
(
0
),
m_impl
(
nullptr
)
{
...
...
@@ -103,10 +102,6 @@ std::array<int, 3> Services::getVersion() const {
return
m_serverVersion
;
}
int
Services
::
getPort
()
const
{
return
m_port
;
}
const
std
::
string
&
Services
::
getStatusEndpoint
()
const
{
return
m_serverStatusEndpoint
;
}
...
...
src/impl/RequesterImpl.cpp
View file @
5b6d5c01
...
...
@@ -94,7 +94,7 @@ void RequesterImpl::sendBinary(const std::string& requestData) {
request
.
pushString
(
m_application
->
getUrl
());
request
.
pushKey
(
message
::
Request
::
SERVER_PORT
);
request
.
pushInt
(
m_application
->
getPort
());
request
.
pushInt
(
m_application
->
getEndpoint
().
getPort
());
request
.
pushKey
(
message
::
Request
::
REQUESTER_PORT
);
request
.
pushInt
(
m_requesterPort
);
...
...
@@ -126,7 +126,7 @@ void RequesterImpl::sendTwoBinaryParts(const std::string& requestData1, const st
request
.
pushString
(
m_application
->
getUrl
());
request
.
pushKey
(
message
::
Request
::
SERVER_PORT
);
request
.
pushInt
(
m_application
->
getPort
());
request
.
pushInt
(
m_application
->
getEndpoint
().
getPort
());
request
.
pushKey
(
message
::
Request
::
REQUESTER_PORT
);
request
.
pushInt
(
m_requesterPort
);
...
...
Shervin Nourbakhsh
@nourbakhsh
mentioned in commit
46e44691
·
Apr 23, 2021
mentioned in commit
46e44691
mentioned in commit 46e44691a03808a23a464818487b0dd014a9c57e
Toggle commit list
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