lwip-devel
[Top][All Lists]
Advanced

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

[lwip-devel] [bug #38853] connect() use a wrong errno


From: hanhui
Subject: [lwip-devel] [bug #38853] connect() use a wrong errno
Date: Mon, 29 Apr 2013 15:51:36 +0000
User-agent: Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.43 Safari/537.31

URL:
  <http://savannah.nongnu.org/bugs/?38853>

                 Summary: connect() use a wrong errno
                 Project: lwIP - A Lightweight TCP/IP stack
            Submitted by: hanhui03
            Submitted on: Mon Apr 29 15:51:35 2013
                Category: sockets/netconn
                Severity: 3 - Normal
              Item Group: Faulty Behaviour
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: 
            lwIP version: git head

    _______________________________________________________

Details:

EALREADY : A connection request is already in progress for the specified
socket.

EISCONN: The specified socket is connection-mode and is already connected.

EALREADY is NOT same as EISCONN, but lwip is only use "ERR_ISCONN" as
EALREADY.

Some software(for example Qt/Embedded) whill check EISCONN to determine
whether the connection is successful!

I suggest that add a netconn error code : ERR_ALREADY used to distinguish
these two cases.

err_t
tcp_connect(struct tcp_pcb *pcb, ip_addr_t *ipaddr, u16_t port,
tcp_connected_fn connected)
{
  if (pcb->state == ESTABLISHED) {
    return ERR_ISCONN;
  } else if (pcb->state != CLOSED) {
    return ERR_ALREADY;
  }

  ...
}





    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?38853>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/




reply via email to

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