Additional to my post:
If somebody wants to reconstruct the situation on the FRDM-K64F, follow these steps:
- Load the lwIP_httpsrv example. I use the Version with FreeRTOS. You will find it at: SDK_2.2_FRDM-K64F\boards\frdmk64f\demo_apps\lwip\lwip_httpsrv
- Run it.
- Start a browser which has WebSocket combability and open the test webpage.
- Select the WebSocket example and press the Connect button to set up a session.
- Now you should be able to send messages to your server, with getting an echo response.
- Let this connection alive and open a new browser.
- Call the Test webpage again and try to set up another WebSocket connection.
At this point I am not able, to connect with my server. If I Disconnect first session now, it will serve that the second session connects without pressing the Connect button again. So, are multiple connections not possible?
I have had a look at httpsrv_server_task() function in httpsrv_task.c. The semaphore $server->ses_cnt is taken but not released if one connection is alive. The rest of the code of that function seems to be programmed for more than one connection. I also have set the max_ses param high enough, to 5.
If I change the semaphore, so that I can set up more connections, the callback functions of the second connection are not working correctly. I get a response from the connect callback, but never from the message, error or disconnect callback. Because of that I am not able to receive any data or du abort the second connection.
If you need more Informations, please let me know. Would be great to get any help.
Best regards
Jan