summaryrefslogtreecommitdiffstats
path: root/host/lib/transport
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-07-07 23:48:09 -0700
committerJosh Blum <josh@joshknows.com>2010-07-07 23:48:09 -0700
commitc72bc56ba6d5b0457f03967a8f8d8e5602fdf14d (patch)
tree13acfd23ac9906977c8364044e4cf0f90fb389a7 /host/lib/transport
parentbe430761fb7e526e80b67d70e3cf488c6dd02495 (diff)
downloaduhd-c72bc56ba6d5b0457f03967a8f8d8e5602fdf14d.tar.gz
uhd-c72bc56ba6d5b0457f03967a8f8d8e5602fdf14d.tar.bz2
uhd-c72bc56ba6d5b0457f03967a8f8d8e5602fdf14d.zip
usrp2: moved common defined for udp mtu and implemented change.
The uhp mtu is now defined in uhd_simple.hpp. The fw common code does not need to know this information. Fixed a calculation bug in the usrp2 impl code for max samples.
Diffstat (limited to 'host/lib/transport')
-rw-r--r--host/lib/transport/udp_zero_copy_asio.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/host/lib/transport/udp_zero_copy_asio.cpp b/host/lib/transport/udp_zero_copy_asio.cpp
index 7f9292d24..86ea275c1 100644
--- a/host/lib/transport/udp_zero_copy_asio.cpp
+++ b/host/lib/transport/udp_zero_copy_asio.cpp
@@ -16,6 +16,7 @@
//
#include <uhd/transport/udp_zero_copy.hpp>
+#include <uhd/transport/udp_simple.hpp> //mtu
#include <uhd/utils/assert.hpp>
#include <boost/cstdint.hpp>
#include <boost/asio.hpp>
@@ -29,7 +30,6 @@ using namespace uhd::transport;
**********************************************************************/
//enough buffering for half a second of samples at full rate on usrp2
static const size_t MIN_SOCK_BUFF_SIZE = size_t(sizeof(boost::uint32_t) * 25e6 * 0.5);
-static const size_t MAX_DGRAM_SIZE = 1500; //assume max size on send and recv
static const double RECV_TIMEOUT = 0.1; //100 ms
/***********************************************************************
@@ -51,8 +51,8 @@ public:
const std::string &addr,
const std::string &port
):
- phony_zero_copy_recv_if(MAX_DGRAM_SIZE),
- phony_zero_copy_send_if(MAX_DGRAM_SIZE)
+ phony_zero_copy_recv_if(udp_simple::mtu),
+ phony_zero_copy_send_if(udp_simple::mtu)
{
//std::cout << boost::format("Creating udp transport for %s %s") % addr % port << std::endl;
@@ -93,11 +93,11 @@ public:
//This way, the transport caller will have an idea about how much buffering to create.
size_t get_num_recv_frames(void) const{
- return this->get_buff_size<boost::asio::socket_base::receive_buffer_size>()/MAX_DGRAM_SIZE;
+ return this->get_buff_size<boost::asio::socket_base::receive_buffer_size>()/udp_simple::mtu;
}
size_t get_num_send_frames(void) const{
- return this->get_buff_size<boost::asio::socket_base::send_buffer_size>()/MAX_DGRAM_SIZE;
+ return this->get_buff_size<boost::asio::socket_base::send_buffer_size>()/udp_simple::mtu;
}
private: