summaryrefslogtreecommitdiff
path: root/louloulibs/network
diff options
context:
space:
mode:
authorlouiz’ <louiz@louiz.org>2016-11-07 14:43:07 +0100
committerlouiz’ <louiz@louiz.org>2016-11-07 14:43:07 +0100
commit7376831bc8f6dbec8eaf4f4c0a6bba819a0a1e59 (patch)
tree05c48f84e1fd90d6d811a4e73b67503dda45db60 /louloulibs/network
parent50d7590db426ce821148af769ea18d556e97f393 (diff)
downloadbiboumi-7376831bc8f6dbec8eaf4f4c0a6bba819a0a1e59.tar.gz
biboumi-7376831bc8f6dbec8eaf4f4c0a6bba819a0a1e59.tar.bz2
biboumi-7376831bc8f6dbec8eaf4f4c0a6bba819a0a1e59.tar.xz
biboumi-7376831bc8f6dbec8eaf4f4c0a6bba819a0a1e59.zip
Add get-irc-connection-info adhoc command
fix #3171
Diffstat (limited to 'louloulibs/network')
-rw-r--r--louloulibs/network/tcp_socket_handler.cpp12
-rw-r--r--louloulibs/network/tcp_socket_handler.hpp3
2 files changed, 15 insertions, 0 deletions
diff --git a/louloulibs/network/tcp_socket_handler.cpp b/louloulibs/network/tcp_socket_handler.cpp
index 9decee1..1dddde5 100644
--- a/louloulibs/network/tcp_socket_handler.cpp
+++ b/louloulibs/network/tcp_socket_handler.cpp
@@ -179,6 +179,8 @@ void TCPSocketHandler::connect(const std::string& address, const std::string& po
if (this->use_tls)
this->start_tls();
#endif
+ this->connection_date = std::chrono::system_clock::now();
+
this->on_connected();
return ;
}
@@ -397,6 +399,16 @@ bool TCPSocketHandler::is_connecting() const
return this->connecting || this->resolver.is_resolving();
}
+bool TCPSocketHandler::is_using_tls() const
+{
+ return this->use_tls;
+}
+
+std::string TCPSocketHandler::get_port() const
+{
+ return this->port;
+}
+
void* TCPSocketHandler::get_receive_buffer(const size_t) const
{
return nullptr;
diff --git a/louloulibs/network/tcp_socket_handler.hpp b/louloulibs/network/tcp_socket_handler.hpp
index 7bbe4d4..6c4235e 100644
--- a/louloulibs/network/tcp_socket_handler.hpp
+++ b/louloulibs/network/tcp_socket_handler.hpp
@@ -106,6 +106,9 @@ public:
#endif
bool is_connected() const override final;
bool is_connecting() const;
+ bool is_using_tls() const;
+ std::string get_port() const;
+ std::chrono::system_clock::time_point connection_date;
private:
/**