khoih-prog/WebSockets2_Generic

Running Http and Websocket Servers concurrently

khoih-prog opened this issue · 1 comments

@jakespeed1311

This is an issue from WebSockets_Generic Library relating to this WebSockets2_Generic Library

Support as Http server and the webscok server on Arduino DUE

Moving it now to the correct place

Probably it works because your clients are constantly querying the websocket and can do that ?

If you specify your problem early, it'll be helpful and save time

OK, if I understand correctly now, your problem is that

  1. the WebSocketServer is in blocking mode
  2. you don't have any WebSockets Client
  3. WS Server is blocked, waiting for Client before moving forward
  4. The HTTP WebServer can't continue.

If so, I think I can fix the problem by modifying the WebSockets2_Generic Library.

Please wait until I find out the fix and post the new release.

I'm moving the issue to the correct place of WebSockets2_Generic Library.

Hi @jakespeed1311

The new Version v1.0.6 has been released with these new features to fix the blocking action of WebSockets Server that prevents the concurrent running of WebServer and WebSockets Server you experienced so far.

New in v1.0.6

  1. Add non-blocking WebSockets Server feature to enable WS Server and WebServer running concurently. See Support as Http server and the Websockets server on Arduino DUE and Running Http and Websocket Servers concurrently. Thanks to bug report and persistence of Jake.
  2. Add non-blocking WebSockets Server and WebServer examples.
  3. Add Ethernet Library Patches
  4. Add Arduino SAMD Packages_Patches to fix compiler errors when using Standard Template Library STL

Please try the example SAMDUE-Ethernet_AdvancedWebServer to have feelings. Then modify it to fix your purpose.

Please be noted that your bug report and persistence, resulting in the new Version v1.0.6, has been noted in Contributions-and-Thanks