lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] Best way for determining if a TCP connection is dead?


From: Chris Seto
Subject: Re: [lwip-users] Best way for determining if a TCP connection is dead?
Date: Wed, 24 Jan 2018 10:43:08 -0600

Additionally, what is the best way to determine if a TCP connection failed (ie, the server is down)?

It seems like the jump occurs between 
// Fill in IP and connect
IP4_ADDR(&DestIPaddr, SERVER_ADDR0, SERVER_ADDR1, SERVER_ADDR2, SERVER_ADDR3);
tcp_connect(appPcb, &DestIPaddr, SERVER_PORT, NetworkApp_connected);

and the NetworkApp_connected callback being called. 

But what if the connected callback never is run? If I already have the ability to poll, what should I watch for to indicate the connection never went though?

Thanks

On Wed, Jan 24, 2018 at 10:35 AM, Chris Seto <address@hidden> wrote:
I have some code which works great, based on the echo client example.

I'm working on hardening it, and I'm wondering with how best to deal with a dead TCP connection as a result of the network link being down (ie, Ethernet cable disconnected).

The echo client contains conditions for a software termination of the socket (ie, server sends am empty frame), but I don't see anything dealing with a more blunt loss of the connection.

Any advice?

Thanks,
Chris 


reply via email to

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