Page 1 of 1

XTCP LWIP: how to handle TCP timeouts

Posted: Fri Apr 17, 2020 1:01 pm
by magnus
Hi,

It seems to me that the XTCP LWIP stack does not have a way to handle TCP timeouts?
I expected the XTCP_TIMED_OUT event to be fired but while debugging I noticed that it is never used within lib_xtcp (only the uip stack).

Confusingly the api/xtcp.h file does expose the following enum:

Code: Select all

typedef enum {
  ARP_TIMEOUT = 0,
  AUTOIP_TIMEOUT,
  TCP_TIMEOUT,
  IGMP_TIMEOUT,
  DHCP_COARSE_TIMEOUT,
  DHCP_FINE_TIMEOUT,
  NUM_TIMEOUTS
} xtcp_lwip_timeout_type;
But I don't know how I'd use it for anything related to the API.

Have I missed something?

Re: XTCP LWIP: how to handle TCP timeouts

Posted: Mon Apr 20, 2020 12:54 pm
by akp
That xtcp_lwip_timeout_type is used for firing periodic functions. Are you finding an unexpected behaviour?

Re: XTCP LWIP: how to handle TCP timeouts

Posted: Mon Apr 20, 2020 1:44 pm
by magnus
But that seems to be only used internally? (I was just confused whether I could use it for anything since it is in the api header)

The problem I have is that my application never gets notified that a TCP connection has timed out. So if, for whatever reason, a TCP connection has timed out I will never notice and reclaim the resources that have been reserved.