Multiple WebSocket connections with the demo_app from SDK

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Multiple WebSocket connections with the demo_app from SDK

1,273 Views
j_h
Contributor I

Hey All,

I am developing on a project with FRDM-K64F and the SDK_2.2_FRDM-K64F.

For my control unit, I need the server side implementation of the WebSocket protocol. For a first entry, I took your lwIP_httpsrv demo application from the SDK.

My question:

Is it possible to set up multiple WebSocket connections with that demo? Until now, I was not able to get more than one session at the same time running.

Any experiences or ideas?

Best regards

Jan

Labels (1)
0 Kudos
4 Replies

984 Views
j_h
Contributor I

Additional to my post:

 

If somebody wants to reconstruct the situation on the FRDM-K64F, follow these steps:

  1. 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
  2. Run it.
  3. Start a browser which has WebSocket combability and open the test webpage.
  4. Select the WebSocket example and press the Connect button to set up a session.
  5. Now you should be able to send messages to your server, with getting an echo response.
  6. Let this connection alive and open a new browser.
  7. 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

0 Kudos

984 Views
danielchen
NXP TechSupport
NXP TechSupport

Hi Jan:

As I remember, the HTTP server should support multiple WEB sockets. I will check it later.

Regards

Daniel

0 Kudos

984 Views
j_h
Contributor I

Hey Daniel,

do you have any new findings? It is still not possible for me to get multiple connections with that example program.

Regards

Jan

0 Kudos

984 Views
danielchen
NXP TechSupport
NXP TechSupport

Hi Jan:

I can reproduce your issue on my end. I have reported this issue to the software team.

Regards

Daniel

0 Kudos