From 0add09088e7652465bdf5d19281a7a1fc535082c Mon Sep 17 00:00:00 2001 From: Raj Bhattacharjea Date: Mon, 12 May 2008 15:12:26 -0400 Subject: [PATCH] Use the correct semantics for sendcallback --- examples/tcp-large-transfer.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/examples/tcp-large-transfer.cc b/examples/tcp-large-transfer.cc index 8c7b16c5d..76c57f642 100644 --- a/examples/tcp-large-transfer.cc +++ b/examples/tcp-large-transfer.cc @@ -206,7 +206,12 @@ void WriteUntilBufferFull (Ptr localSocket, uint32_t nBytes) char m = toascii (97 + i % 26); data[i] = m; } - localSocket->Send (data, curSize); + uint32_t amountSent = localSocket->Send (data, curSize); + if(amountSent < curSize) + { + std::cout << "Socket blocking, returning" << std::endl; + return; + } nBytes -= curSize; } }