GlobalLogger.debug() << "consuming unused " << ReplyBuffer.size() << "bytes!" << endl;
ReplyBuffer.consume( ReplyBuffer.size() );
- // Waiting for a reply. We prepare the buffer to receive up to 64KB.
+ // Waiting for a reply, We prepare the buffer to receive up to SOCKET_BUFFER_SIZE bytes
Socket.async_receive(
- ReplyBuffer.prepare( 65536 ),
+ ReplyBuffer.prepare( SOCKET_BUFFER_SIZE ),
boost::bind( &IcmpPinger::handle_receive_icmp_packet, this, _2 )
);
}
// Boost pinger (c) 2011 by Guilherme Maciel Ferreira / Intra2net AG
// Based upon work copyright (c) 2003-2010 Christopher M. Kohlhoff (ping.cpp)
+// Modified 2014 by Christian Herdtweck, Intra2net AG
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// IcmpPinger
//-----------------------------------------------------------------------------
+
+/// size of buffer used to read from socket in [bytes]
+const std::size_t SOCKET_BUFFER_SIZE = 65536; // 64kB
+
/**
* @brief This class performs an ICMP ping to host using Boost Asio.
* Scope: one object per host.