diff options
author | Josh Blum <josh@joshknows.com> | 2011-02-07 12:32:12 -0800 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2011-02-07 12:32:12 -0800 |
commit | ef351624eeb898e17662000a40b50076133118c7 (patch) | |
tree | 841cc50addc98183bf4b6a35dbe2b5375d08cc6c /host/lib/transport/udp_zero_copy_asio.cpp | |
parent | fec5fc2d319ab2808f88d2f4cec734a8102f18ca (diff) | |
download | uhd-ef351624eeb898e17662000a40b50076133118c7.tar.gz uhd-ef351624eeb898e17662000a40b50076133118c7.tar.bz2 uhd-ef351624eeb898e17662000a40b50076133118c7.zip |
uhd: replace asio buffer in make safe w/ memory and length, makes things simpler
Diffstat (limited to 'host/lib/transport/udp_zero_copy_asio.cpp')
-rw-r--r-- | host/lib/transport/udp_zero_copy_asio.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/host/lib/transport/udp_zero_copy_asio.cpp b/host/lib/transport/udp_zero_copy_asio.cpp index 0f16e7d14..90cd2a9ce 100644 --- a/host/lib/transport/udp_zero_copy_asio.cpp +++ b/host/lib/transport/udp_zero_copy_asio.cpp @@ -149,7 +149,8 @@ public: asio::mutable_buffer buff; if (_pending_recv_buffs.pop_with_timed_wait(buff, timeout)){ return managed_recv_buffer::make_safe( - buff, boost::bind( + asio::buffer_cast<const void *>(buff), + asio::buffer_size(buff), boost::bind( &udp_zero_copy_asio_impl::release, this, asio::buffer_cast<void*>(buff) ) @@ -193,10 +194,8 @@ public: and _pending_recv_buffs.pop_with_haste(buff) ){ return managed_recv_buffer::make_safe( - asio::buffer( - boost::asio::buffer_cast<void *>(buff), - _socket->receive(asio::buffer(buff)) - ), + boost::asio::buffer_cast<void *>(buff), + _socket->receive(asio::buffer(buff)), boost::bind( &udp_zero_copy_asio_impl::release, this, asio::buffer_cast<void*>(buff) @@ -231,7 +230,8 @@ public: asio::mutable_buffer buff; if (_pending_send_buffs.pop_with_timed_wait(buff, timeout)){ return managed_send_buffer::make_safe( - buff, boost::bind( + asio::buffer_cast<void *>(buff), + asio::buffer_size(buff), boost::bind( &udp_zero_copy_asio_impl::commit, this, asio::buffer_cast<void*>(buff), _1 ) @@ -258,7 +258,8 @@ public: asio::mutable_buffer buff; if (_pending_send_buffs.pop_with_haste(buff)){ return managed_send_buffer::make_safe( - buff, boost::bind( + asio::buffer_cast<void *>(buff), + asio::buffer_size(buff), boost::bind( &udp_zero_copy_asio_impl::commit, this, asio::buffer_cast<void*>(buff), _1 ) |