Replies: 3 comments 8 replies
-
The connection is a queue where whatever you shove into it, must flow out of it (in order). So if you shove a lot of data into a connection that is slow or just refusing to consume the data, you will get backpressure (queue built-up). You don't have to disconnect, but you have to at least skip sending (which is what games do). So you really only need to do something like: if (connection.getBufferedAmount() == 0) { |
Beta Was this translation helpful? Give feedback.
-
I'm pretty sure you're overcomplicating things now. You don't really need to bother. The only thing you need to do is check buffered amount before sending that's all. |
Beta Was this translation helpful? Give feedback.
-
You actually don't even need to do that check I wrote. It is automatic if you set maxBackpressure: 512 or something. Then the library skips sending anything that can't fit in the queue. So it really is nothing you need to bother with. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm making a game, and admittedly I don't get what backpressure is or how it works, but it seems like it will forcibly disconnect some clients which I don't want.
Beta Was this translation helpful? Give feedback.
All reactions