From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Robert Pluim Newsgroups: gmane.emacs.devel Subject: Re: Is it possible to change the recv buffer size dynamically for network process or subprocess? Date: Sun, 22 Mar 2020 16:12:31 +0100 Message-ID: References: <1de1c276-1bda-4ada-b3f4-7adaee296628@Spark> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="106055"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: HaiJun Zhang Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Mar 22 16:13:52 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jG2IQ-000RRb-Sv for ged-emacs-devel@m.gmane-mx.org; Sun, 22 Mar 2020 16:13:50 +0100 Original-Received: from localhost ([::1]:47174 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jG2IP-0000j1-Te for ged-emacs-devel@m.gmane-mx.org; Sun, 22 Mar 2020 11:13:49 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37207) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jG2HF-0000IS-CT for emacs-devel@gnu.org; Sun, 22 Mar 2020 11:12:38 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jG2HE-0007kA-BV for emacs-devel@gnu.org; Sun, 22 Mar 2020 11:12:37 -0400 Original-Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]:54280) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jG2HE-0007jj-3M for emacs-devel@gnu.org; Sun, 22 Mar 2020 11:12:36 -0400 Original-Received: by mail-wm1-x335.google.com with SMTP id c81so1156160wmd.4 for ; Sun, 22 Mar 2020 08:12:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:gmane-reply-to-list:date:in-reply-to :message-id:mime-version:content-transfer-encoding; bh=R7diKWcNyK0EjtppMbYUCd2gKsqZYS+zfUHAQE6bmLw=; b=nRY5jqnMy+g5GD1Nz6tIzpCndLYGxqPCv0vaw9WmsKcg6aZJgxjqcjE2tJ3ijzW7At ZkHqZTtzNFiJAZvfraJt8Ov5s0sK/mzF/t8xLLSD0/9opesmZHpmGFvaq1RylaQQiPf7 lPnbjIBYUSooP3KshR6nYzmIIAB2ZB+UNmpMH7eE5+1famQo0uOnIDGkY/Qmj48mF6XI GJa7UBdSXJj3tKzC869z19PXdN5163VNlDQZW+mru60EY+9vLTdGWZioGlJ4yBe4SY1N m/Fc8BgtYIN6XUrQ1CiHF8Q9MLUrFjtEIr97G4fWsSpywPOZFEZof2QhCYxTf7qbfdHC piqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references :gmane-reply-to-list:date:in-reply-to:message-id:mime-version :content-transfer-encoding; bh=R7diKWcNyK0EjtppMbYUCd2gKsqZYS+zfUHAQE6bmLw=; b=T7fjDV5Phb/WPqPL9lkty/JJD9KbNThg0crWSovLxorYCX+MkVYYkTIob/GgxRKEWZ 8yYlOPPaQhxQoF8f3iHhzJ2PB4ZHIqLMxdGnu61qWwgP/xlAHXMxIF86lFmtrxxxPOOd ETPxyQodp+DeJrrVv5mZTwdDo7pgmCLRQQevHeFBYdg3ug0+9yVWtnli3lbsXjnhfRfN SVm3yF/FAcovK1zEkxouSwM/oWmTJ4DBqz5kGsgdhuEe8sHnDZYQzonStBp1PRbG1H/7 kdD3o5NPEY3fvKKO/fmiXtXDmDGcJV8h9kbIt+PjeFi4aJ6ZLkF7g/3FpWRPzXWVsPg3 b5hA== X-Gm-Message-State: ANhLgQ39w3j8NckS/w/Hj/yvRjaJsQSOcgyY0qS8zR1uyqWvCR0QR9bW cFd0//aHToljQAU12UJEU5MdEbOm X-Google-Smtp-Source: ADFU+vuQA6i9+/qRrpQcRu6ESCzZtx41lZMaFWWLDrEl5r/IQqmb6s61mq9Lw1uMJenHnMToaajcWQ== X-Received: by 2002:a05:600c:4145:: with SMTP id h5mr21760765wmm.3.1584889953878; Sun, 22 Mar 2020 08:12:33 -0700 (PDT) Original-Received: from rpluim-mac ([2a01:e34:ecfc:a860:2867:4995:9986:65c2]) by smtp.gmail.com with ESMTPSA id i4sm19593153wrm.32.2020.03.22.08.12.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Mar 2020 08:12:33 -0700 (PDT) Gmane-Reply-To-List: yes In-Reply-To: (HaiJun Zhang's message of "Sun, 22 Mar 2020 09:26:37 +0800") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::335 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:245673 Archived-At: >>>>> On Sun, 22 Mar 2020 09:26:37 +0800, HaiJun Zhang said: HaiJun> I want to do flow control, because too many data may cause UI HaiJun> unresponsive. Set the recv buffer size to 4, and if I don=E2=80= =99t fetch the HaiJun> four bytes, please don=E2=80=99t receive more data. If the size= (In the four HaiJun> bytes header) is too big, ask the user if the message should be HaiJun> received. I don=CA=BCt see how this is any different from just doing recv, checking the 4 bytes, and then asking the user. In any case, if the remote end has sent you the message, it will be in the local kernel buffers anyway, so you'll have to read it at some point anyway. Anyway, emacs-27 has read-process-output-max, which I guess you could set to 4, but I suspect that will cause all sorts of other issues. Robert