Several second delay between nx_tcp_socket_disconnect and disconnect complete callback

Michael Fowler 131 Reputation points
2023-08-23T00:17:08.4266667+00:00

Hello,

I want to drop all open TCP connections if the network link goes down. In the link status change callback I call nx_tcp_socket_disconnect. Several seconds later, the disconnect complete callback is called. I'm wondering what causes that delay and if there is a better way to approach this. Thanks.

Azure RTOS
Azure RTOS
An Azure embedded development suite including a small but powerful operating system for resource-constrained devices.
331 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Tiejun Zhou 1,126 Reputation points Microsoft Employee
    2023-08-24T01:58:40.42+00:00

    There should be no delay to invoke nx_tcp_socket_disconnect in link status change callback. One possible reason is that network driver blocks sending the FIN packet.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.