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]

RE: Misguided error code in net code?


  > 
  > Gary Thomas wrote:
  > >
  > > On 19-Jul-2001 Trenton D. Adams wrote:
  > > > I just ran a test sending a big string from eCos over the
network.
  > My
  > > > one end terminated prematurely because I forgot to put in a loop
  > because
  > > > my buffer is only 8K.  Anyhow, on the eCos end I got an error of
22
  > > > (EINVAL) from send.  I could be wrong, but this seems like a
pretty
  > > > weird error when the other end drops the connection.  I would
have
  > > > expected ECONNRESET.
  > > >
  > >
  > > I disagree - your request sounds pretty "invalid" to me.
  > >
  > > Honestly, most of this stuff (like what errors get returned when)
come
  > > from the standard BSD stack we're using - code that's been out
there
  > for
  > > twenty years.  (The numeric values may be different, but the codes
the
  > same)
  > 
  > While that's true, the world moves on, and the upcoming update to
POSIX
  > 1003.1 now says it should return EPIPE (or possibly ECONNRESET).
After a
  > brief look, it's probably returning EINVAL at line 228 of
  > sys/netinet/tcp_usrreq.c but I don't know for sure. Even so, I
couldn't
  > be
  > sure that changing that to ECONNRESET is appropriate because I
wouldn't
  > know what other circumstances could cause this to happen. Trenton,
if
  > you're sufficiently bothered, feel free to investigate.
  > 

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.


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