Is using WebSocketConnectionPtr outside of WebSocketController callbacks safe? #2353
Unanswered
itBeABruhmoment
asked this question in
Q&A
Replies: 1 comment
-
Yes, it is safe to use in any thread. |
Beta Was this translation helpful? Give feedback.
0 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.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to write a game server that uses web sockets. As a result, I plan on having a continuously running thread that will send information to all connected clients each game tick. To implement this, the game thread would need a list of all socket connections. I plan on doing this by saving every WebSocketConnectionPtr given by WebSocketController.handleNewConnection to a map, which the game thread can access and use.
Would this be safe or does using a WebSocketConnectionPtr from outside a WebSocketController callback break some assumptions? Also, is the web socket implementation thread safe?
Beta Was this translation helpful? Give feedback.
All reactions