]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#3478] Added getNative() to HTTP listener
authorFrancis Dupont <fdupont@isc.org>
Wed, 31 Jul 2024 10:34:09 +0000 (12:34 +0200)
committerFrancis Dupont <fdupont@isc.org>
Wed, 21 Aug 2024 07:58:57 +0000 (09:58 +0200)
src/lib/http/listener.cc
src/lib/http/listener.h
src/lib/http/listener_impl.cc
src/lib/http/listener_impl.h

index 3cc8ec944d60ad176e973e449479df6c99d9518c..544a4b46e7443d5204155309b21c29f1dd1820a7 100644 (file)
@@ -42,6 +42,11 @@ HttpListener::getLocalPort() const {
     return (impl_->getEndpoint().getPort());
 }
 
+int
+HttpListener::getNative() const {
+    return (impl_->getNative());
+}
+
 void
 HttpListener::start() {
     impl_->start();
index 6cc1a7d7e3df714b12abaad511145073c1fd795b..c05a60d1dbc9c66e4f4616a67ee46b4f89675d8a 100644 (file)
@@ -115,6 +115,9 @@ public:
     /// @brief Returns local port on which server is listening.
     uint16_t getLocalPort() const;
 
+    /// @brief file descriptor of the underlying acceptor socket.
+    int getNative() const;
+
     /// @brief Starts accepting new connections.
     ///
     /// This method starts accepting and handling new HTTP connections on
index 7f28858de2f4759596b11325dd9fcefdf22be6cb..771b6e9469517994c20744f13e7d40b720893044 100644 (file)
@@ -67,6 +67,11 @@ HttpListenerImpl::getEndpoint() const {
     return (*endpoint_);
 }
 
+int
+HttpListenerImpl::getNative() const {
+    return (acceptor_ ? acceptor_->getNative() : -1);
+}
+
 void
 HttpListenerImpl::start() {
     try {
index d41ff299012fa754b7f08a8d96d7be7d1f0d6b07..1608c945537d1ce0657f23612064fe5776feb803 100644 (file)
@@ -59,6 +59,9 @@ public:
     /// @brief Returns reference to the current listener endpoint.
     const asiolink::TCPEndpoint& getEndpoint() const;
 
+    /// @brief file descriptor of the underlying acceptor socket.
+    int getNative() const;
+
     /// @brief Starts accepting new connections.
     ///
     /// This method starts accepting and handling new HTTP connections on