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: Robert Pluim
Subject: Re: Is it possible to change the recv buffer size dynamically for network process or subprocess?
Date: Sat, 21 Mar 2020 13:10:24 +0100

>>>>> 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



reply via email to

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