[ECOS] TCP sockets- recv returns EAGAIN
Gorjup Matthias
Matthias.Gorjup@SIEMENS.AT
Fri Jul 23 08:40:00 GMT 2004
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
More information about the Ecos-discuss
mailing list