diff --git a/includes/tacopie/network/tcp_client.hpp b/includes/tacopie/network/tcp_client.hpp index 7f60bda..d768c7e 100644 --- a/includes/tacopie/network/tcp_client.hpp +++ b/includes/tacopie/network/tcp_client.hpp @@ -53,6 +53,11 @@ class tcp_client { bool operator==(const tcp_client& rhs) const; bool operator!=(const tcp_client& rhs) const; +public: + //! get host & port information + const std::string& get_host(void) const; + std::uint32_t get_port(void) const; + public: //! start & stop the tcp client void connect(const std::string& addr, std::uint32_t port); @@ -148,4 +153,4 @@ class tcp_client { disconnection_handler_t m_disconnection_handler; }; -} //! tacopie +} // namespace tacopie diff --git a/sources/network/tcp_client.cpp b/sources/network/tcp_client.cpp index b53e502..5aa4c7c 100644 --- a/sources/network/tcp_client.cpp +++ b/sources/network/tcp_client.cpp @@ -53,6 +53,20 @@ tcp_client::tcp_client(tcp_socket&& socket) m_io_service->track(m_socket); } +//! +//! get host & port information +//! + +const std::string& +tcp_client::get_host(void) const { + return m_socket.get_host(); +} + +std::uint32_t +tcp_client::get_port(void) const { + return m_socket.get_port(); +} + //! //! start & stop the tcp client //! @@ -268,4 +282,4 @@ tcp_client::operator!=(const tcp_client& rhs) const { return !operator==(rhs); } -} //! tacopie +} // namespace tacopie