(E-Mail Removed) wrote:
> Hello Group,
>
> I am doing a socket read
>
> char buf[2048];
> int readLen = 2048;
>
> cout<< "Readlen = " << readLen << endl; // Prints Readlen = 2048
> read(sockfd, buf, readLen);
> cout<< "Readlen = " << readLen << endl; // Prints Readlen = 28169
>
> Can someone tell me what is going on. What went wrong. I am working
> on Redhat Linux
> platform.
>
> Thx.
>
> arun
>
1. Make sure you #include <unistd.h>
2. Check the return value of your read() and, if it is -1, print out the
value of errno.
Robert