I use websockets to transfer video-y images from a server written in Go to the client, which is an HTML page. Below is my experience with Chrome.
I get images through the onmessage websocket handler. When I receive the image, I may need to complete several tasks asynchronously before I can display the image. Even if these tasks are not finished yet, another onmessage () may occur. I donβt want to queue images, because at the moment I canβt act as fast as it does on the server, and because it makes no sense to display old images. I also do not want to drop these images, I do not want to receive them at all.
Whether the client will use a traditional TCP connection, it will simply stop reading from the connection. This will lead to the filling of the reception buffer, closing the reception window and, ultimately, the suspension of sending images to the server. As soon as the client starts reading, the receive buffers will be empty, the receive window will open, and the server will resume transmission. Each time my server starts sending an image, it selects the most recent one. This is the best behavior, as well as TCP flow control, which guarantees reasonable behavior in many cases.
Is it possible to have TCP flow control features on which websites are based with web windows? I am particularly interested in a solution that depends on TCP flow control and application-level flow control, as this leads to an undesirable additional delay.
source share