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.