From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Stefan Monnier 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 14:13:02 -0400 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="14519"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Robert Pluim , 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 19:13:54 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 1jG56f-0003iZ-H5 for ged-emacs-devel@m.gmane-mx.org; Sun, 22 Mar 2020 19:13:53 +0100 Original-Received: from localhost ([::1]:48744 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jG56e-0006P5-Cm for ged-emacs-devel@m.gmane-mx.org; Sun, 22 Mar 2020 14:13:52 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55815) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jG55w-00060X-9j for emacs-devel@gnu.org; Sun, 22 Mar 2020 14:13:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jG55u-0006h2-Ie for emacs-devel@gnu.org; Sun, 22 Mar 2020 14:13:07 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:39195) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jG55u-0006gr-CV for emacs-devel@gnu.org; Sun, 22 Mar 2020 14:13:06 -0400 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 6E2F3100865; Sun, 22 Mar 2020 14:13:05 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id DB12D1006FC; Sun, 22 Mar 2020 14:13:03 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1584900783; bh=9/b5lwwYjE49M+q5efRclEwWdcDNd4/Do4ababaWqoA=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=B1yJ0ievEXtJTb2CO3v0UMhfAwDOUyMxLoqwB0AicLtZy44l0ms6AvfysNBN5B4Aj WySFmGYWu+O814FLAc5sIlP7H7/k+7gn6XJAYbT/c1+GTEGYKWBPoCbaR6WvIs3pzc 3AEiHoubMvn5fWYgEsxA/2/R6XyXadWYAkYnG1jBE46ykF4idsWbC9JYMFy+9I3WOp D55kOahLzoaI3rVtYBhI1Uc6dmRdTkxeDMjlt5S4cJBtRopXXFMus7CTQ2A98/eQ++ J9tZtl/S0TX6VqdcYClllje59bwKXcNue9FWjtMM8YQTsip5eVuZbS2fB67t/CIUGB G+8pBFaO/q5mA== Original-Received: from alfajor (unknown [104.247.241.114]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 81E1F1203F3; Sun, 22 Mar 2020 14:13:03 -0400 (EDT) In-Reply-To: (HaiJun Zhang's message of "Sun, 22 Mar 2020 09:26:37 +0800") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 132.204.25.50 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:245689 Archived-At: > 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=E2=80=99t fetch= the four > bytes, please don=E2=80=99t receive more data. If the size (In the four b= ytes > header) is too big, ask the user if the message should be received. I think I understand your description, and I think I understand somewhat how Emacs's code works in this respect, but I really don't see how the two relate. Presumably you're writing Elisp code using Emacs's process filters. What is the concrete problem you're seeing that you're trying to solve (your description seems to focus on *how* to solve your problem)? Does Emacs take too long to react to some events? Does its memory use grow unreasonably? Is the rest of the system affected? Stefan