lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] When TCP connection fails


From: JM
Subject: Re: [lwip-users] When TCP connection fails
Date: Fri, 13 Nov 2009 04:55:01 -0800 (PST)

How is the error callback specified?  I have not been able to find this.  Also, I looked in the rawapi.txt file and found this, which further confuses me:

  The tcp_connect() function returns immediately; it does not wait for
  the connection to be properly setup. Instead, it will call the
  function specified as the fourth argument (the "connected" argument)
  when the connection is established. If the connection could not be
  properly established, either because the other host refused the
  connection or because the other host didn't answer, the "connected"
  function will be called with an the "err" argument set accordingly.


--- On Thu, 11/12/09, Jeff Barber <address@hidden> wrote:

From: Jeff Barber <address@hidden>
Subject: Re: [lwip-users] When TCP connection fails
To: "Mailing list for lwIP users" <address@hidden>
Date: Thursday, November 12, 2009, 7:50 AM

(Assuming I'm following the code correctly...)
You will get the connected callback only if successful.  If the connection fails, you will get the error callback instead with one of two error codes:
If the connection is rejected with a RST (I think that would mean that the system is there but no server is listening on that port), the error code would be ERR_RST. 
If a timeout occurs after the maximum number of SYN retries [TCP_SYNMAXRTX] is reached (i.e. no response from server), the error code would be ERR_ABRT.

Jeff

On Wed, Nov 11, 2009 at 4:59 PM, JM <address@hidden> wrote:
Easy question I hope:

(1.3.0, in Raw mode)

When I call tcp_connect() it immediately returns error-free as expected.  The question is, what happens when the connection fails, as in, the host never responds?  I thought maybe it calls the "connected" callback specified in tcp_connect() with an error after TCP_SYNMAXRTX retries, but this doesn't appear to happen. 



_______________________________________________
lwip-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/lwip-users


-----Inline Attachment Follows-----

_______________________________________________
lwip-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/lwip-users


reply via email to

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