This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
RE: Misguided error code in net code?
- To: "'Jonathan Larmour'" <jlarmour at redhat dot com>
- Subject: RE: [ECOS] Misguided error code in net code?
- From: "Trenton D. Adams" <tadams at extremeeng dot com>
- Date: Fri, 20 Jul 2001 09:05:22 -0600
- Cc: "'eCos mailing list'" <ecos-discuss at sources dot redhat dot com>
- Organization: Extreme Engineering
>
> "Trenton D. Adams" wrote:
> >
> > I might just do that if I have problems in the future with it when
I
> get
> > down to actually writing some real net code. The thing I find
weird,
> is
> > how you supposed to tell if a connection has been reset? I
suppose I
> > could go over to the other system and see if it disconnected, but
> that's
> > just a work around.
>
> You could use select() or possibly write() may give different
answers.
>
I just used write (), and it returns 360 ETIMEDOUT. This is slightly
better. I (me alone ;) ) would expect that an ETIMEDOUT error should
only occur when the connection is still there but there is no response
from the other end.
When this happens on Linux or windows though, I do actually get a
ECONNRESET. I'm not positive about the Linux side, but windows
definitely does.