emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is it possible to change the recv buffer size dynamically for networ


From: HaiJun Zhang
Subject: Re: Is it possible to change the recv buffer size dynamically for network process or subprocess?
Date: Sun, 22 Mar 2020 09:26:37 +0800

在 2020年3月21日 +0800 PM8:10,Robert Pluim <address@hidden>,写道:
On Sat, 21 Mar 2020 11:01:05 +0800, HaiJun Zhang <address@hidden> said:

HaiJun> For example, I have binary message format like this:
HaiJun> 1. It has a four-bytes header and payload.
HaiJun> 2. The four-bytes header is the payload size of the message.

HaiJun> First I want to set the size of the recv buffer to 4. After the four
HaiJun> bytes arrived, I parse them and get the size of the payload. Then I
HaiJun> set the size of the recv buffer to the size of the payload to recv the
HaiJun> payload.

Why bother? Youʼre going to have to handle partial recv for the
payload anyway, so you might as well do it from the start.

Robert 

I want to do flow control, because too many data may cause UI unresponsive. Set the recv buffer size to 4, and if I don’t fetch the four bytes, please don’t receive more data. If the size (In the four bytes header) is too big, ask the user if the message should be received.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]