port can be set with the constructor

add a method to return the port
This commit is contained in:
luddens 2019-06-26 11:27:23 +02:00 committed by Matthieu Gautier
parent 8164b4dadc
commit c17abdae5e
2 changed files with 3 additions and 2 deletions

View File

@ -9,12 +9,13 @@ namespace kiwix {
class KiwixServe
{
public:
KiwixServe();
KiwixServe(int port = 8181);
~KiwixServe();
void run();
void shutDown();
bool isRunning();
int getPort() { return m_port; }
private:
std::unique_ptr<Subprocess> mp_kiwixServe;

View File

@ -13,7 +13,7 @@
namespace kiwix {
KiwixServe::KiwixServe() : m_port(8181)
KiwixServe::KiwixServe(int port) : m_port(port)
{
}