32 #ifndef _uhal_tests_TCPDummyHardware_hpp_ 33 #define _uhal_tests_TCPDummyHardware_hpp_ 36 #include <boost/asio.hpp> 45 template< u
int8_t IPbus_major , u
int8_t IPbus_minor >
58 TCPDummyHardware (
const uint16_t& aPort ,
const uint32_t& aReplyDelay,
const bool& aBigEndianHack ) :
59 DummyHardware< IPbus_major , IPbus_minor > ( aReplyDelay , aBigEndianHack ) ,
void handle_accept(const boost::system::error_code &aError)
void handle_read_chunk_header(const boost::system::error_code &ec, std::size_t length)
uint32_t mByteCountHeader
Value of 'byte count' header at start of latest TCP chunk.
boost::asio::ip::tcp::acceptor mAcceptor
The TCP acceptor which opens the TCP port and handles the connection.
DummyHardware< IPbus_major, IPbus_minor > base_type
Define the underlying DummyHardware type to be a more convenient label.
TCPDummyHardware(const uint16_t &aPort, const uint32_t &aReplyDelay, const bool &aBigEndianHack)
Constructor.
Concrete implementation of emulator of hardware using TCP.
boost::asio::ip::tcp::endpoint mSenderEndpoint
The endpoint which sent the UDP datagram.
boost::asio::io_service mIOservice
The BOOST ASIO io_service used by the TCP server.
void handle_read_chunk_payload(const boost::system::error_code &ec, std::size_t length)
~TCPDummyHardware()
Destructor.
boost::asio::ip::tcp::socket mSocket
The socket opened by the TCP server.
Abstract base class to emulate IPbus hardware.
void run()
Concrete implementation of the run function Starts the TCP server and runs indefinitely, until exception or user kills the server.
void stop()
Stops this dummy hardware instance - i.e. makes the 'run' method return.