Have trouble reading the data from sockets.
Hi,
I am facing an issue when reading the data from socket. Write into
fd tells that data has been written but when the server tries to read,
it return 0 bytes. This is seen only when all the socket fd's are
utilized. I dont see any issues with the memory buffers.
Iam using the non blocking with linger turned on.
Can anyone please help me to reslove this issue.
Thanks,
Seema.
Re: Have trouble reading the data from sockets.
In article
<9a2dab43-18d0-4468-9b25-27fbdd74bba8@i76g2000hsf.googlegroups.com>,
seema <seema.kauser@gmail.com> wrote:
[color=blue]
> Hi,
>
> I am facing an issue when reading the data from socket. Write into
> fd tells that data has been written but when the server tries to read,
> it return 0 bytes. This is seen only when all the socket fd's are
> utilized. I dont see any issues with the memory buffers.
>
> Iam using the non blocking with linger turned on.
> Can anyone please help me to reslove this issue.[/color]
If read() returns 0 it means that it read EOF, i.e. the connection has
been closed. But that shouldn't happen until it has read everything the
client has written.
There's probably a bug in your program. Based on the details you've
provided, I think it's somewhere between line 1 and the last line.
--
Barry Margolin, [email]barmar@alum.mit.edu[/email]
Arlington, MA
*** PLEASE don't copy me on replies, I'll read them in the group ***