Skip to content
Discussion options

You must be logged in to vote

The UpgradeSync example shows this: https://github.com/uNetworking/uWebSockets/blob/master/examples/UpgradeSync.cpp

You pass a copy of your PerSocketData struct via the res->upgrade call. But, because it is sync, you can also just use a global thread_local variable to temporary point to something in the request. This is not very elegant but it does work and removes the need to keep more than necessary in your PerSocketData.

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants