aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/transport/udp_common.hpp
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2011-02-20 02:41:03 -0800
committerJosh Blum <josh@joshknows.com>2011-02-20 02:41:03 -0800
commit4787c77bb089bf50a47207bbad55bd65a44769e4 (patch)
treec89a196ea0161b357a9136c271592ecf1b895127 /host/lib/transport/udp_common.hpp
parent2d9838f467013d5397b6daf83afb5ccea92065a4 (diff)
downloaduhd-4787c77bb089bf50a47207bbad55bd65a44769e4.tar.gz
uhd-4787c77bb089bf50a47207bbad55bd65a44769e4.tar.bz2
uhd-4787c77bb089bf50a47207bbad55bd65a44769e4.zip
udp: try non-blocking recv first for performance
Diffstat (limited to 'host/lib/transport/udp_common.hpp')
-rw-r--r--host/lib/transport/udp_common.hpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/host/lib/transport/udp_common.hpp b/host/lib/transport/udp_common.hpp
index 44067b5dc..47775d9c4 100644
--- a/host/lib/transport/udp_common.hpp
+++ b/host/lib/transport/udp_common.hpp
@@ -23,13 +23,15 @@
namespace uhd{ namespace transport{
+ typedef boost::shared_ptr<boost::asio::ip::udp::socket> socket_sptr;
+
/*!
* Wait for the socket to become ready for a receive operation.
* \param sock_fd the open socket file descriptor
* \param timeout the timeout duration in seconds
* \return true when the socket is ready for receive
*/
- UHD_INLINE bool wait_for_recv(int sock_fd, double timeout){
+ UHD_INLINE bool wait_for_recv_ready(int sock_fd, double timeout){
//setup timeval for timeout
timeval tv;
//If the tv_usec > 1 second on some platforms, select will