Hi,
I know the size of the message coming from a client at runtime. So I create a buffer:
Code:
iDynBuffer = HBufC8::NewL(dataSize);
... enabled writing:
Code:
TPtr8 dynBufferPtr(NULL,dataSize);
dynBufferPtr.Set(iDynBuffer->Des());
... fill the descriptor to its maximum length
Code:
iConnectedSocket.Read(dynBufferPtr, iStatus);
... the issuing of a request
The problem is with HBufC8. You can read in the SDK documentation: ... the resulting maximum length of the descriptor, may be larger than requested due to the way memory is allocated in Symbian OS.
So instead of 10 bytes Read is trying to fill 12 bytes. I understand this approach, but what is the correct one when using Read/Send functions?
update: Interesting post, and the second one