// First, we should enable this macro in lwipopts.h
#define LWIP_TCP_KEEPALIVE 1

//
The following code is implemented after tcp_new() or in tcp_connected call back
... xxx_connected(..., struct tcp_pcb* tpcb, ...) { tpcb->so_options |= SOF_KEEPALIVE; tpcb->keep_idle = 5000; // ms tpcb->keep_intvl = 5000; // ms tpcb->keep_cnt = 2; // report error after 2 KA without response }

 

相关文章:

  • 2021-09-14
  • 2021-07-28
  • 2021-10-07
  • 2022-12-23
  • 2022-12-23
  • 2022-02-04
  • 2022-12-23
猜你喜欢
  • 2021-10-13
  • 2021-09-10
  • 2021-10-08
  • 2022-12-23
  • 2021-05-30
  • 2021-12-03
  • 2022-12-23
相关资源
相似解决方案