[Top][All Lists]

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

Re: [lwip-devel] lwip 1.3.2 with safertos

From: Simon Goldschmidt
Subject: Re: [lwip-devel] lwip 1.3.2 with safertos
Date: Wed, 08 Aug 2012 08:06:13 +0200

"Seymen Ertaş" <address@hidden> wrote:
> 1) If i deliberately go to an address that doesn't exist (bad IP or server
> down...) It looks like my hc_error function never gets called.

That's kind of normal, it's the timeout for TCP connect that happens to be very 
high. This is the case for most IP stacks. You could work around this by using 
nonblocking connect and watching the time yourself or using connect timeout.

> Additionally
> after I call tcp_connect my hc_poll function is never called either so i
> am
> unable to detect the error case and abort the connection.

Hmm, I think that's correct. It might be worth thinking about calling tcp_poll 
while trying to connect...

> 2) I have to constantly increment my port number for each connection i
> create for some reason when hitting the IIS server the original connection
> is never properly closed even though I am calling tcp_close. ( Please note
> that i had to switch using to tcp_bind(pcb, IP_ADDR_ANY, 0); instead of
> specifying a single port number. )

That's normal TCP behaviour. When connecting to a remote server (where the port 
is constant), you must not reuse your local port or the remote server has no 
way of knowing if segments are really new or just retransmissions of the old 
connection arriving late.

Just don't call tcp_bind() for outgoing connections and you should be good.


reply via email to

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