[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] socket API error values

From: Simon Goldschmidt
Subject: Re: [lwip-users] socket API error values
Date: Thu, 13 Mar 2014 21:51:08 +0100

We tried to make the error values in sockets.c standard conformant, so that's probably the reason they changed from 1.3.2 to 1.4.1. Do you think there is an error in the compatiblity or do you just want to get the old values back?
BTW: The "this would be how I'd like it" line below seems wrong, since an lwip error is in the table...
BTW2: EALREADY is defined in arch.h since 2003... Did you mix up standard error defines with lwip error defines?
Von: "Fabian Koch" <address@hidden>
we just ported from 1.3.2 to 1.4.1 and some of our programs stopped working because the error codes the socket API returns apparently changed.
can someone explain, why ERR_ISCONN is mapped to EALREADY in line 145 of sockets.c?

static const int err_to_errno_table[] = {
  0,             /* ERR_OK          0      No error, everything OK. */
  ENOMEM,        /* ERR_MEM        -1      Out of memory error.     */
  ENOBUFS,       /* ERR_BUF        -2      Buffer error.            */
  EWOULDBLOCK,   /* ERR_TIMEOUT    -3      Timeout                  */
  EHOSTUNREACH,  /* ERR_RTE        -4      Routing problem.         */
  EINPROGRESS,   /* ERR_INPROGRESS -5      Operation in progress    */
  EINVAL,        /* ERR_VAL        -6      Illegal value.           */
  EWOULDBLOCK,   /* ERR_WOULDBLOCK -7      Operation would block.   */
  EADDRINUSE,    /* ERR_USE        -8      Address in use.          */
  ERR_ISCONN,    /* ERR_ISCONN     -9      Already connected.       */ <=== this would be how I'd like it ;o)
  ECONNABORTED,  /* ERR_ABRT       -10     Connection aborted.      */
  ECONNRESET,    /* ERR_RST        -11     Connection reset.        */
  ENOTCONN,      /* ERR_CLSD       -12     Connection closed.       */
  ENOTCONN,      /* ERR_CONN       -13     Not connected.           */
  EIO,           /* ERR_ARG        -14     Illegal argument.        */
  -1,            /* ERR_IF         -15     Low-level netif error    */

The interesting part is that EALREADY is not defined in the err.h of LwIP. (In ours it is...)

kind regards,
_______________________________________________ lwip-users mailing list address@hidden https://lists.nongnu.org/mailman/listinfo/lwip-users

reply via email to

[Prev in Thread] Current Thread [Next in Thread]