lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] TCP keep-alive not working on half-closed connections


From: address@hidden
Subject: Re: [lwip-users] TCP keep-alive not working on half-closed connections
Date: Wed, 6 Jun 2018 14:45:29 +0200
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0

On 06.06.2018 11:42, R. Diez wrote:
[..]
The trouble is, this changes the connection state (pcb->state) from
ESTABLISHED to FIN_WAIT_1, which then turns quickly into FIN_WAIT_2.
Afterwards, TCP keep-alive does not work anymore, because of this logic
in tcp_slowtmr():

    /* Check if KEEPALIVE should be sent */
    if (ip_get_option(pcb, SOF_KEEPALIVE) &&
       ((pcb->state == ESTABLISHED) ||
        (pcb->state == CLOSE_WAIT))) {

If I then pull the server's Ethernet cable while the connection is
transferring data, the connection never times out on the client.

I am no TCP/IP expert. Is there an error in my reasoning regarding
half-closed connections? Can TCP keep-alive packets, whatever they are,
still be sent and/or received on half-closed TCP connections?
Half-opened connections should be usable like you did it, yes. I'm not sure about keepalives though.
Technically, keepalives are just empty ACKs, so that should work.

However, I'm not sure wether tcp keepalive is meant to work on half-open connections.


Simon



reply via email to

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