lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] Half-Open detecting


From: Steven Woody
Subject: Re: [lwip-users] Half-Open detecting
Date: Thu, 21 Apr 2011 21:45:53 +0800

On 21 April 2011 20:48, Stephen Cleary <address@hidden> wrote:
>> As a TCP server, I want to detect half-open state that may fall in
>> either of the following cases:
>>
>> 1. Established connection broken somehow, but the peer still send
>> segments to me, in this case, there will not be a pcb on my side
>> matches.
>> 2. Peer crashed somehow, but I still in 'established' state, then the
>> peer send a SYN to me. In this case, still no a connection on my side
>> could match.
>
> I don't believe lwIP supports keepalives, though I may be wrong.
>
> The normal way to detect a half-open connection is to send data at regular 
> intervals; an lwIP or OS timer would help with this approach (i.e., send a 
> noop message if you haven't written to the socket for some period of time).
>

Understood. It means that at least some kind of keep-alive mechanism
(app level or TCP level) has to be provided.

> An alternative solution is to keep listening all the time, and abort the 
> existing connection when a new one arrives. This assumes that your design is 
> for a single client.
>

I was reading the code, my understand is:  when a new SYN comes, my
old pcb must be in active pcbs list, so the new coming SYN will not
get matched in this list, and it also impossible getting match in
listen queue or tw queue. So, this SYN will be dropped.  Am I
understand right?


> You do need to handle this on both sides. I am writing for a similar design 
> (single PC client connecting to a lwIP server), and I'm using the timer 
> solution on the PC side and the abort-on-new-connection solution on the lwIP 
> side.
>
>       -Steve
> _______________________________________________
> lwip-users mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/lwip-users
>



-- 
Life is the only flaw in an otherwise perfect nonexistence
    -- Schopenhauer

narke
public key at http://subkeys.pgp.net:11371 (address@hidden)



reply via email to

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