Can one add WebSocket handler after Server.begin? #283
Replies: 1 comment 5 replies
-
yes, that's possible. there is a handler list that can be updated at runtime, and once a request comes in, the handler list is iterated to find the right handler. the only thing you need to pay attention to is concurrency across cores: it can crash if you concurrently update the list while iterating to find the right handler. So make sure the code that does the update runs on the same core than the async_tcp task. |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
For some reason, I have to add a WebSocket handler after starting AsyncWebServer with Server.begin():
Looks like it works, but is this a proper approach?
Beta Was this translation helpful? Give feedback.
All reactions