How to implement tcp flow control at the application layer in ktor

16 views Asked by At

I am using ktor in kotlin to design a tcp communication program that requires very high speed and as little memory consumption as possible.

The simplest and most convenient flow control scheme for an ordered and reliable connection like TCP should determine whether to continue sending data or not based on the actual size of the send buffer. It does not require additional messages and a large cache.

However, I don't seem to see an API on how to read the actual size of the current send buffer in the relevant kotlin documentation, can I do that?

I don't want my program to block because the buffer is full, because then I will complicate the flow of my program.

0

There are 0 answers