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

Wi-Fi Combo Forum Discussions

ChMa_3922746
Level 5
Level 5
10 likes received 10 likes given 5 likes given

I am running an HTTPS server (the one under libraries/daemons/HTTP_Server) and after a while of connecting via various devices, I can get it to stop responding to incoming packets.  http_server_event_thread_main() waits indefinitely:

result = wiced_rtos_pop_from_queue( &server->event_queue, &current_event, WICED_NEVER_TIMEOUT );

However, when I manually call the following, it recovers:

wiced_tcp_server_stop(...);

wiced_tcp_server_start(...);

So, the TCP server appears to stop responding for some reason.

Any ideas on what could be responsible for chopping the TCP server off at its knees?

Thanks!

0 Likes
1 Solution
ChMa_3922746
Level 5
Level 5
10 likes received 10 likes given 5 likes given

When I restart the server, the log says "No free socket found. Looks like all the sockets are currently in use".  It appears that, over time, all sockets on the server get used up and are not freed.  If I replace WICED_NEVER_TIMEOUT with a specific time period, and add the following in http_server_event_thread_main(), the streams are disconnected and sockets are re-initialized:

wiced_http_disconnect_all_response_stream(server);

The server appears to carry on after that.

View solution in original post

0 Likes
1 Reply
ChMa_3922746
Level 5
Level 5
10 likes received 10 likes given 5 likes given

When I restart the server, the log says "No free socket found. Looks like all the sockets are currently in use".  It appears that, over time, all sockets on the server get used up and are not freed.  If I replace WICED_NEVER_TIMEOUT with a specific time period, and add the following in http_server_event_thread_main(), the streams are disconnected and sockets are re-initialized:

wiced_http_disconnect_all_response_stream(server);

The server appears to carry on after that.

0 Likes