Skip to content

Commit d619d7b

Browse files
committed
[#3478] Added getNative() to HTTP listener
1 parent 254d49f commit d619d7b

File tree

4 files changed

+16
-0
lines changed

4 files changed

+16
-0
lines changed

src/lib/http/listener.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ HttpListener::getLocalPort() const {
4242
return (impl_->getEndpoint().getPort());
4343
}
4444

45+
int
46+
HttpListener::getNative() const {
47+
return (impl_->getNative());
48+
}
49+
4550
void
4651
HttpListener::start() {
4752
impl_->start();

src/lib/http/listener.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,9 @@ class HttpListener {
115115
/// @brief Returns local port on which server is listening.
116116
uint16_t getLocalPort() const;
117117

118+
/// @brief file descriptor of the underlying acceptor socket.
119+
int getNative() const;
120+
118121
/// @brief Starts accepting new connections.
119122
///
120123
/// This method starts accepting and handling new HTTP connections on

src/lib/http/listener_impl.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,11 @@ HttpListenerImpl::getEndpoint() const {
6767
return (*endpoint_);
6868
}
6969

70+
int
71+
HttpListenerImpl::getNative() const {
72+
return (acceptor_ ? acceptor_->getNative() : -1);
73+
}
74+
7075
void
7176
HttpListenerImpl::start() {
7277
try {

src/lib/http/listener_impl.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ class HttpListenerImpl {
5959
/// @brief Returns reference to the current listener endpoint.
6060
const asiolink::TCPEndpoint& getEndpoint() const;
6161

62+
/// @brief file descriptor of the underlying acceptor socket.
63+
int getNative() const;
64+
6265
/// @brief Starts accepting new connections.
6366
///
6467
/// This method starts accepting and handling new HTTP connections on

0 commit comments

Comments
 (0)