Unverified Commit 03a65a8b authored by Igor [hyperxor]'s avatar Igor [hyperxor] Committed by GitHub

Small improvements in Listener constructor (#785)

* Small improvements in Listener constructor

* Trigger CI
parent 88df7c35
......@@ -45,7 +45,7 @@ public:
TimePoint tick;
};
Listener();
Listener() = default;
~Listener();
explicit Listener(const Address &address);
......@@ -81,15 +81,15 @@ public:
private:
Address addr_;
int listen_fd;
int backlog_;
int listen_fd = -1;
int backlog_ = Const::MaxBacklog;
NotifyFd shutdownFd;
Polling::Epoll poller;
Flags<Options> options_;
std::thread acceptThread;
size_t workers_;
size_t workers_ = Const::DefaultWorkers;
std::string workersName_;
std::shared_ptr<Handler> handler_;
......
......@@ -148,15 +148,7 @@ void setSocketOptions(Fd fd, Flags<Options> options) {
}
}
Listener::Listener()
: addr_(), listen_fd(-1), backlog_(Const::MaxBacklog), shutdownFd(),
poller(), options_(), workers_(Const::DefaultWorkers), workersName_(),
reactor_(), transportKey() {}
Listener::Listener(const Address &address)
: addr_(address), listen_fd(-1), backlog_(Const::MaxBacklog), shutdownFd(),
poller(), options_(), workers_(Const::DefaultWorkers), workersName_(),
reactor_(), transportKey() {}
Listener::Listener(const Address &address) : addr_(address) {}
Listener::~Listener() {
if (isBound())
......
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