Skip to content

Commit

Permalink
Try a more elegant solution that should decrease the TCP sending late…
Browse files Browse the repository at this point in the history
…ncy.
  • Loading branch information
slav-at-attachix committed Jul 12, 2019
1 parent 4a41eea commit 306e400
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Sming/Core/Network/TcpClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,17 @@ void TcpClient::pushAsyncPart()
write(stream);

if(stream->isFinished()) {
flush();
debug_d("TcpClient stream finished");
freeStreams();

if(getAvailableWriteSize() > 0) {
// if there is space in the output buffer
// then don't wait for tcp sent confirmation
// and try sending more data now
onReadyToSendData(TcpConnectionEvent::eTCE_Poll);
}

flush();
}
}

Expand Down

0 comments on commit 306e400

Please sign in to comment.