Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
Release 0.3.1 (pending)
==========================

- Preserve packet+burst boundaries in server readStream() endpoint

Release 0.3.0 (2016-07-10)
==========================

Expand Down
5 changes: 4 additions & 1 deletion server/ServerStreamData.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright (c) 2015-2015 Josh Blum
// Copyright (c) 2016-2016 Bastille Networks
// SPDX-License-Identifier: BSL-1.0

#include "ServerStreamData.hpp"
Expand Down Expand Up @@ -162,6 +163,7 @@ void ServerStreamData::sendEndpointWork(void)
size_t elemsRead = 0;
while (not done)
{
flags = 0; //flags is an in/out parameter and must be cleared for consistency
const size_t numElems = std::min(mtuElems, elemsLeft);
ret = device->readStream(stream, buffs.data(), numElems, flags, timeNs, SOAPY_REMOTE_SOCKET_TIMEOUT_US);
if (ret == SOAPY_SDR_TIMEOUT) continue;
Expand All @@ -179,7 +181,8 @@ void ServerStreamData::sendEndpointWork(void)
//fill remaining buffer with no timeout
//This is a latency optimization to forward to the host ASAP,
//but to use the full bandwidth when more data is available.
if (elemsRead != 0 and elemsLeft != 0)
//Do not allow this optimization when end of burst or single packet mode to preserve boundaries
if (elemsRead != 0 and elemsLeft != 0 and (flags & (SOAPY_SDR_END_BURST | SOAPY_SDR_ONE_PACKET)) == 0)
{
int flags1 = 0;
long long timeNs1 = 0;
Expand Down