face: Implementing forgotten isListening() feature in TcpChannel
Change-Id: Idfcd8337d16b414d2f739f936660dffdce413729
diff --git a/daemon/face/tcp-channel.cpp b/daemon/face/tcp-channel.cpp
index 28fdfa5..4c438be 100644
--- a/daemon/face/tcp-channel.cpp
+++ b/daemon/face/tcp-channel.cpp
@@ -16,6 +16,7 @@
TcpChannel::TcpChannel(const tcp::Endpoint& localEndpoint)
: m_localEndpoint(localEndpoint)
+ , m_isListening(false)
{
this->setUri(FaceUri(localEndpoint));
}
@@ -45,6 +46,8 @@
bind(&TcpChannel::handleSuccessfulAccept, this, _1,
clientSocket,
onFaceCreated, onAcceptFailed));
+
+ m_isListening = true;
}
void
diff --git a/daemon/face/tcp-channel.hpp b/daemon/face/tcp-channel.hpp
index 3c56cb1..e31723b 100644
--- a/daemon/face/tcp-channel.hpp
+++ b/daemon/face/tcp-channel.hpp
@@ -85,6 +85,9 @@
size_t
size() const;
+ bool
+ isListening() const;
+
private:
void
createFace(const shared_ptr<boost::asio::ip::tcp::socket>& socket,
@@ -128,10 +131,16 @@
typedef std::map< tcp::Endpoint, shared_ptr<Face> > ChannelFaceMap;
ChannelFaceMap m_channelFaces;
- bool isListening;
+ bool m_isListening;
shared_ptr<boost::asio::ip::tcp::acceptor> m_acceptor;
};
+inline bool
+TcpChannel::isListening() const
+{
+ return m_isListening;
+}
+
} // namespace nfd
#endif // NFD_FACE_TCP_CHANNEL_HPP