Why does the open method triggered when opening a WebSocket connection in the code example retrieve a custom structure, PerSocketData, which isn't passed by the client when the connection is opened? #1824
Unanswered
LetAmericaGreatAgain
asked this question in
Q&A
Replies: 1 comment 1 reply
-
PerSocketData has no relation to the client making the connection. PerSocketData is data you need on the server side, per socket. And it's defined by you, as you need it. You init it as you need it, inside .open and use it as you wish |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Why does the open method triggered when opening a WebSocket connection in the code example retrieve a custom structure, PerSocketData, which isn't passed by the client when the connection is opened? Since it is possible to directly access this structure through the ws->getUserData() method on the server side without any user initialization, why isn't this structure embedded into the code library, instead of being user-defined? This really confuses me.
Beta Was this translation helpful? Give feedback.
All reactions