This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
TCP sockets- recv returns EAGAIN
- From: Gorjup Matthias <Matthias dot Gorjup at SIEMENS dot AT>
- To: "''Ecos-Discuss (E-Mail)'" <ecos-discuss at ecos dot sourceware dot org>
- Cc: Raczkowski Fritz <Fritz dot Raczkowski at siemens dot com>
- Date: Fri, 23 Jul 2004 10:06:39 +0200
- Subject: [ECOS] 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