9 #include <boost/asio/ip/multicast.hpp> 35 [
this](boost::system::error_code
const& ec,
size_t bytes_received) {
41 boost::system::error_code
const& ec,
size_t bytes_received) {
45 JB_LOG(
info) <<
"error received in mold_udp_channel::handle_received: " 46 << ec.message() <<
" (" << ec <<
")";
50 if (bytes_received <= 0) {
60 auto recv_ts = std::chrono::steady_clock::now();
76 JB_LOG(
info) <<
"Mismatched sequence number, expected=" 84 for (std::size_t block = 0; block != block_count; ++block) {
87 bytes_received,
buffer_, offset);
100 offset += message_size;
std::size_t message_offset_
static T r(std::size_t size, void const *msg, std::size_t offset)
Read a single message or field.
mold_udp_channel(boost::asio::io_service &io, buffer_handler const &handler, udp_receiver_config const &cfg)
Constructor, create a socket and register for IO notifications.
socket_t make_socket_udp_recv(boost::asio::io_service &io, udp_receiver_config const &cfg)
Create a socket given the configuration parameters.
static std::size_t const buflen
std::function< void(std::chrono::steady_clock::time_point, std::uint64_t, std::size_t, char const *, std::size_t)> buffer_handler
A callback function type to process any received ITCH-5.0 messages.
constexpr std::size_t sequence_number_offset
The location of the sequence number field within the header.
void handle_received(boost::system::error_code const &ec, size_t bytes_received)
The Boost.ASIO callback for I/O events.
void restart_async_receive_from()
Refactor code to register (and reregister) for Boost.ASIO notifications.
std::uint64_t expected_sequence_number_
boost::asio::ip::udp::endpoint sender_endpoint_
constexpr std::size_t header_size
The total size of the MoldUDP64 header.
boost::asio::ip::udp::socket socket_
constexpr std::size_t block_count_offset
The location of the block count field within the header.
A configuration object for UDP receivers.
Create and manage a socket to receive MoldUDP64 packets.
The top-level namespace for the JayBeams library.