16 boost::asio::ip::udp::socket
_sock;
51 return my->_sock.send_to( boost::asio::buffer(buffer, length),
to_asio_ep(to) );
53 catch(
const boost::system::system_error& e )
55 if( e.code() != boost::asio::error::would_block )
60 my->_sock.async_send_to( boost::asio::buffer(buffer, length),
to_asio_ep(to),
63 return completion_promise->
wait();
71 return my->_sock.send_to( boost::asio::buffer(buffer.get(), length),
to_asio_ep(to) );
73 catch(
const boost::system::system_error& e )
75 if( e.code() != boost::asio::error::would_block )
80 my->_sock.async_send_to( boost::asio::buffer(buffer.get(), length),
to_asio_ep(to),
83 return completion_promise->
wait();
87 my->_sock.open( boost::asio::ip::udp::v4() );
88 my->_sock.non_blocking(
true);
91 my->_sock.set_option(boost::asio::socket_base::receive_buffer_size(s) );
102 size_t bytes_read = my->_sock.receive_from( boost::asio::buffer(receive_buffer.get(), receive_buffer_length),
103 boost_from_endpoint );
104 from =
to_fc_ep(boost_from_endpoint);
107 catch(
const boost::system::system_error& e )
109 if( e.code() != boost::asio::error::would_block )
115 my->_sock.async_receive_from( boost::asio::buffer(receive_buffer.get(), receive_buffer_length),
118 size_t bytes_read = completion_promise->
wait();
119 from =
to_fc_ep(boost_from_endpoint);
128 size_t bytes_read = my->_sock.receive_from( boost::asio::buffer(receive_buffer, receive_buffer_length),
129 boost_from_endpoint );
130 from =
to_fc_ep(boost_from_endpoint);
133 catch(
const boost::system::system_error& e )
135 if( e.code() != boost::asio::error::would_block )
141 my->_sock.async_receive_from( boost::asio::buffer(receive_buffer, receive_buffer_length), boost_from_endpoint,
143 size_t bytes_read = completion_promise->
wait();
144 from =
to_fc_ep(boost_from_endpoint);
154 return to_fc_ep( my->_sock.local_endpoint() );
162 my->_sock.set_option( boost::asio::ip::multicast::enable_loopback(s) );
166 my->_sock.set_option( boost::asio::ip::udp::socket::reuse_address(s) );
170 my->_sock.set_option( boost::asio::ip::multicast::join_group( boost::asio::ip::address_v4(a) ) );