1 Reply Latest reply on Feb 18, 2020 9:40 AM by ChMa_3922746

    TCP Server Dies (CYW943907AEVAL1F)


      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:




      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?



        • 1. Re: TCP Server Dies (CYW943907AEVAL1F)

          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:




          The server appears to carry on after that.