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 <[email protected]> wrote:

From: Jeff Barber <[email protected]>
Subject: Re: [lwip-users] When TCP connection fails
To: "Mailing list for lwIP users" <[email protected]>
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 <[email protected]> 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

[email protected]

http://lists.nongnu.org/mailman/listinfo/lwip-users



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

_______________________________________________
lwip-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/lwip-users


      
_______________________________________________
lwip-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to