1
0
mirror of https://github.com/binary-kitchen/doorlockd synced 2024-12-22 02:14:26 +01:00

TCP connection logging

This commit is contained in:
Ralf Ramsauer 2015-09-22 21:53:27 +02:00
parent c01eb22f91
commit 542f5518a6

View File

@ -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<char> 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);