how to receive a complete TCP message
Posted on 2012-03-27
The following code snippet when run, gives a value for numbytes of 3472 decimal, even though I am sending 20000 bytes (the code I use for sending is also given).
how do I check that all the TCP data has been received and is ready to read? I don't normally know in advance, how large the data is, only that it is sent by one call to the Client Send function.
Server code: // using Indy 10
numbytes = AContext->Connection->Socket->InputBuffer->Size;
client code: // using Indy 9
int n = 20000;
buff = new char[n]; // just some random test data with a known length
delete  buff;