diff --git a/examples/tcp/tcp-large-transfer.cc b/examples/tcp/tcp-large-transfer.cc index 27deb300f..ee94f7448 100644 --- a/examples/tcp/tcp-large-transfer.cc +++ b/examples/tcp/tcp-large-transfer.cc @@ -212,5 +212,8 @@ void WriteUntilBufferFull (Ptr localSocket, uint32_t txSpace) } currentTxBytes += amountSent; } - localSocket->Close (); + if (currentTxBytes >= totalTxBytes) + { + localSocket->Close (); + } }