cancel
Showing results for 
Search instead for 
Did you mean: 

WICED Studio Wi-Fi Combo

ChMa_3922746
Contributor II

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
Contributor II

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