42 my->_sock->send_to(boost::asio::buffer(buffer, length), to);
45 catch(
const boost::system::system_error& e)
47 if(e.code() == boost::asio::error::would_block)
49 auto send_buffer_ptr = std::make_shared<std::vector<char>>(buffer, buffer+length);
50 my->_sock->async_send_to(boost::asio::buffer(send_buffer_ptr.get(), length), to,
51 [send_buffer_ptr](
const boost::system::error_code& , std::size_t )
62 boost::asio::ip::udp::endpoint& to)
66 my->_sock->send_to(boost::asio::buffer(buffer.get(), length), to);
69 catch(
const boost::system::system_error& e)
71 if(e.code() == boost::asio::error::would_block)
73 auto preserved_buffer_ptr = buffer;
74 my->_sock->async_send_to(boost::asio::buffer(preserved_buffer_ptr.get(), length), to,
75 [preserved_buffer_ptr](
const boost::system::error_code& , std::size_t )