From 542f5518a64a42cc80b6201f38f9250f33704b66 Mon Sep 17 00:00:00 2001 From: Ralf Ramsauer Date: Tue, 22 Sep 2015 21:53:27 +0200 Subject: [PATCH] TCP connection logging --- doorlockd/main.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doorlockd/main.cpp b/doorlockd/main.cpp index 34f19ca..9917aff 100644 --- a/doorlockd/main.cpp +++ b/doorlockd/main.cpp @@ -38,10 +38,12 @@ static void signal_handler(int signum) static void session(tcp::socket &&sock) { boost::system::error_code error; - + const auto remoteIP = sock.remote_endpoint().address(); std::vector data; data.resize(SOCKET_BUFFERLENGTH); + l("Incoming TCP connection from " + remoteIP.to_string(), LogLevel::notice); + try { size_t length = sock.read_some(boost::asio::buffer(data), error);