lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] TCP connect timeout?


From: Kieran Mansley
Subject: Re: [lwip-users] TCP connect timeout?
Date: Tue, 12 Dec 2006 11:30:33 +0000

On Tue, 2006-12-12 at 12:23 +0100, Frédéric BERNON wrote:
> Hi group,
> 
> I use lwip 1.2.0 at BSD layer.
>
> If I try to do a TCP connect to an "unplugged" IP device from my lwip 
> platform, I block my socket too long. Is there some features or opts.h values 
> to use to reduce this timeout?
> 
> In tcp.c, I found :
> 
>     if (pcb->state == SYN_SENT && pcb->nrtx == TCP_SYNMAXRTX) {
>       ++pcb_remove;
>       LWIP_DEBUGF(TCP_DEBUG, ("tcp_slowtmr: max SYN retries reached\n"));
>     }
> 
> So, is the connection timeout equal to TCP_SYNMAXRTX * tcp_slowtmr "period" ?

Not quite.  TCP_SYNMAXRTX is the number of times it will retransmit the
SYN before giving up.  It doesn't send one every tcp_slowtmr period
though - the gaps between them increase roughly exponentially.   

> Is reduce TCP_SYNMAXRTX the good way to reduce the TCP connect timeout?

It's pretty much the only way, but I would question why you need to.  I
think it would be better to fix your application to be able to cope with
being blocked, rather than make it dependent on a non-standard TCP
timeout.

Kieran





reply via email to

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