Commit 5b6d5c01 authored by legoc's avatar legoc
Browse files

(split) Removed port member from services classes

parent 8853fa53
......@@ -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;
/**
......
......@@ -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;
......
......@@ -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;
......
......@@ -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);
}
......
......@@ -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;
}
......
......@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment