I\'m looking for a way to send a packet made of a custom data structure through a socket with Boost Asio. At the moment I understand that you can send a string with the stan
here is some example which works for me:
void callback(STRUCT_A& s) { f_strand.post(boost::bind(f, boost::asio::buffer(&s, sizeof(s)))); } void f(boost::asio::mutable_buffers_1 v) { STRUCT_A *a = boost::asio_buffer_cast(v); }