feat(core): adding the port management
This commit is contained in:
parent
d4478022d0
commit
41e56955cd
2 changed files with 13 additions and 3 deletions
|
|
@ -16,10 +16,11 @@
|
||||||
|
|
||||||
class Server {
|
class Server {
|
||||||
private:
|
private:
|
||||||
int _port;
|
unsigned short int _port;
|
||||||
std::string _password;
|
std::string _password;
|
||||||
public:
|
public:
|
||||||
Server();
|
Server();
|
||||||
Server(int port, const std::string &password);
|
Server(int port, const std::string &password);
|
||||||
~Server();
|
~Server();
|
||||||
|
unsigned short int getPort() const;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -31,12 +31,21 @@ Server::Server() : _port(0), _password("") {
|
||||||
* @note Thanks to check the port / password before give them to the constructor.
|
* @note Thanks to check the port / password before give them to the constructor.
|
||||||
*/
|
*/
|
||||||
Server::Server(int port, const std::string &password) : _port(port), _password(password) {
|
Server::Server(int port, const std::string &password) : _port(port), _password(password) {
|
||||||
std::cout << CLR_GREY << "[INFO] Server constructor called" << CLR_RESET << std::endl;
|
std::cout << CLR_GREY << "Info: Server constructor called" << CLR_RESET << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief The default destructor of the Server class.
|
* @brief The default destructor of the Server class.
|
||||||
*/
|
*/
|
||||||
Server::~Server() {
|
Server::~Server() {
|
||||||
std::cout << CLR_GREY << "[INFO] Server destructor called" << CLR_RESET << std::endl;
|
std::cout << CLR_GREY << "Info: Server destructor called" << CLR_RESET << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief The getter of the port.
|
||||||
|
*
|
||||||
|
* @return the port of the server
|
||||||
|
*/
|
||||||
|
unsigned short int Server::getPort() const {
|
||||||
|
return this->_port;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue