From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40511) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XOknE-000577-LC for qemu-devel@nongnu.org; Tue, 02 Sep 2014 05:54:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XOkn8-0003hP-IO for qemu-devel@nongnu.org; Tue, 02 Sep 2014 05:54:28 -0400 Received: from mx-v6.kamp.de ([2a02:248:0:51::16]:52934 helo=mx01.kamp.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XOkn8-0003h3-8j for qemu-devel@nongnu.org; Tue, 02 Sep 2014 05:54:22 -0400 Message-ID: <540593C9.5010302@kamp.de> Date: Tue, 02 Sep 2014 11:54:17 +0200 From: Peter Lieven MIME-Version: 1.0 References: <1409649717-17004-1-git-send-email-pl@kamp.de> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] ui/vnc: set TCP_NODELAY List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: QEMU Developers , Gerd Hoffmann On 02.09.2014 11:36, Peter Maydell wrote: > On 2 September 2014 10:21, Peter Lieven wrote: >> we currently have the Nagle algorithm enabled for all outgoing VNC updates. >> This may delay sensitive updates as mouse movements or typing in the console. >> As we currently prepare all data in a buffer and then send as much as we can >> this should not cause big trouble. Well established VNC servers like TightVNC >> set TCP_NODELAY as well. >> A regular framebuffer update request generates exactly one framebuffer update >> which should be pushed out as fast as possible. >> >> Signed-off-by: Peter Lieven >> --- >> ui/vnc.c | 4 ++++ >> 1 file changed, 4 insertions(+) >> >> diff --git a/ui/vnc.c b/ui/vnc.c >> index 1bc1ae0..b12d0ea 100644 >> --- a/ui/vnc.c >> +++ b/ui/vnc.c >> @@ -2885,6 +2885,10 @@ static void vnc_listen_read(void *opaque, bool websocket) >> } >> >> if (csock != -1) { >> +#ifdef TCP_NODELAY >> + int flag = 1; >> + setsockopt(csock, IPPROTO_TCP, TCP_NODELAY, (char *) &flag, sizeof(int)); >> +#endif >> vnc_connect(vs, csock, false, websocket); > Why not just call socket_set_nodelay() ? I was not aware of that helper function. Thanks for the pointer. Peter > > thanks > -- PMM