2#include <ossia/detail/config.hpp>
4#include <boost/asio/buffer.hpp>
5#include <boost/asio/error.hpp>
16 void operator()(
const char* data, std::size_t sz)
const { socket.write(data, sz); }
19template <
typename Socket>
20struct multi_socket_writer
22 std::vector<Socket>& sockets;
23 void write(
const boost::asio::const_buffer& buf)
25 for(
auto& sock : sockets)
30 void write_some(
const boost::asio::const_buffer& buf)
32 for(
auto& sock : sockets)
39template <
typename T,
typename F>
40struct stream_processor
44 template <
typename... Args>
45 void operator()(Args&&... args)
const
47 this->on_message(std::forward<Args>(args)...);
50 bool validate_stream(boost::system::error_code ec)
const
52 if(ec == boost::asio::error::operation_aborted)
58 if(ec == boost::asio::error::eof)