Skip to content

uWebSocket Crashed when I enable websocket compression. #930

Answered by ghost
balloonwj asked this question in Q&A
Discussion options

You must be logged in to vote

Hello,

If you look at the deepest part of your stack; start_thread and follow the stack up to where it crashes in deflate_fast you see that there is no call to us_loop_run. In other words, you are not sending from the thread that owns the socket.

This library is strictly single threaded and needs one event-loop per thread, just like Node.js and similar. If you want to send from another thread you have to use us_wakeup_loop and send from the wakeup callback. However this incurs a few kernel calls and you also miss the fast path, since you need to buffer up the data somewhere until the wakeup callback can consume it.

Replies: 5 comments

Comment options

You must be logged in to vote
0 replies
Answer selected
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
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
Converted from issue

This discussion was converted from issue #930 on December 09, 2020 03:07.