I'm interested in comparing POSIX and Symbian's socket APIs. My initial Symbian program is inspired by Stevens's daytime example (see http://www.kohala.com/start/). His example is a UNIX/C program which is equivalent to this telnet command.
% telnet time-a.nist.gov 13
53706 05-12-02 19:23:42 00 1 0 381.5 UTC(NIST) *
When I wrote the Symbian version, I used the RSocket::Read(). I give my descriptor buffer a length of 64. Power of two and long enough to read the string entire string in one go. When I run the program on 7.0s, it fails. iStatus is set to KErrEof and the buffer discriptor is empty. So, I changed the buffer size to 16 which is less than the size of the string. This time the program works as expected. Read() fills the buffer descriptor with the first 16 characters and the iStatus is KErrNone.
Since it is rare for the last read call to completely fill the buffer, this behavior seems strange. Although it does seems consistent with the SDK definition. How does one use the RSocket::Read() with the length of the data received is unknown?