This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

TCP sockets- recv returns EAGAIN


Hello,

we have problems implementing a TCP socket server on our ARM platform. We
are using eCos 1.3.1.

Our socket server tries to read on each socket by calling
recvfrom(socket[i], buffer, sizeof(buffer),MSG_DONTWAIT, NULL, NULL)

If the peer sockets get closed without notifying our server (for example,
the network connection goes down), recv returns -1 and errno=EAGAIN.
This goes on forever...

What should we do to close these "zombie" sockets? Should we count number of
EAGAINs returned for each socket and close when this number reaches certain
level?

Note that we can not close sockets on first EAGAIN because maybe the peer
socket is still alive but simply can not send data at the moment and that we
call select() with timeout 10ms.



Best Regards

Matthias Gorjup

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]