socket disconnect event missed

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
agmi_3321141
Level 4
Level 4
5 likes given First like received First like given

I send a few different types of requests using the http_client (connect -> send requests while connected). I observe that sometimes the socket disconnect callback does not get triggered when internet connection is lost. Instead the requests are flushed successfully, but there is no response. The socket state shows WICED_SOCKET_CONNECTED. After a certain time interval, the requests start timing out. Can you help to figure out how to debug this? I am interested in finding out why the callback is not generated and what can be done to fix it.

0 Likes
1 Solution

Hello:

    I want to know if the connection is stopped in a normal way as http_server side disassociates the connection by itself,   but the physical connection distance is keeping,  then to see if the disconnection callback is triggered or not.   In other words if we just carry the board to go away from the connection, http servers should have no ability to send the disconnection event to client side.  Then there should have some timeouts in client side,  after a while the application knows the connection is broken, but not reported from server side .  Is that correct from your phenomenon ?

View solution in original post

0 Likes
3 Replies
Zhengbao_Zhang
Moderator
Moderator
Moderator
250 sign-ins First comment on KBA 10 questions asked

Hello:

   Does below description mean even connection is broken , but requests are sent to server with success?

You are expecting a disconnection callback, thus you will not send the requests .

“I observe that sometimes the socket disconnect callback does not get triggered when internet connection is lost. Instead the requests are flushed successfully”

0 Likes

By flushed successfully I mean that the http_request_flush function returns with WICED_SUCCESS and socket state is WICED_SOCKET_CONNECTED. I can handle the case in application, but I'm interested in knowing why the callback is missed or the socket state is not updated.

0 Likes

Hello:

    I want to know if the connection is stopped in a normal way as http_server side disassociates the connection by itself,   but the physical connection distance is keeping,  then to see if the disconnection callback is triggered or not.   In other words if we just carry the board to go away from the connection, http servers should have no ability to send the disconnection event to client side.  Then there should have some timeouts in client side,  after a while the application knows the connection is broken, but not reported from server side .  Is that correct from your phenomenon ?

0 Likes