Permalink
Browse files

socket: resize the blob to MTU before receive

  • Loading branch information...
1 parent 0bedc18 commit d2a81af8ab65d8557668783e229ccc5c1daaa2d5 @guruofquality committed Aug 28, 2012
Showing with 2 additions and 0 deletions.
  1. +2 −0 lib/socket_to_blob.cc
View
@@ -87,6 +87,7 @@ class gr_udp_to_blob_impl : public socket_to_blob{
//perform a blocking receive
pmt::pmt_t blob = _mgr->acquire(true /*block*/);
+ pmt::pmt_blob_resize(blob, _mtu);
const size_t num_bytes = _socket->receive(asio::buffer(
pmt::pmt_blob_rw_data(blob), _mtu
));
@@ -162,6 +163,7 @@ class gr_tcp_to_blob_impl : public socket_to_blob{
//perform a blocking receive
pmt::pmt_t blob = _mgr->acquire(true /*block*/);
+ pmt::pmt_blob_resize(blob, _mtu);
const size_t num_bytes = _socket->receive(asio::buffer(
pmt::pmt_blob_rw_data(blob), _mtu
));

0 comments on commit d2a81af

Please sign in to comment.