* [Qemu-devel] [PATCH] ui/vnc: set TCP_NODELAY
@ 2014-09-02 9:21 Peter Lieven
2014-09-02 9:36 ` Peter Maydell
0 siblings, 1 reply; 3+ messages in thread
From: Peter Lieven @ 2014-09-02 9:21 UTC (permalink / raw)
To: qemu-devel; +Cc: Peter Lieven, kraxel
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 <pl@kamp.de>
---
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);
}
}
--
1.7.9.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] ui/vnc: set TCP_NODELAY
2014-09-02 9:21 [Qemu-devel] [PATCH] ui/vnc: set TCP_NODELAY Peter Lieven
@ 2014-09-02 9:36 ` Peter Maydell
2014-09-02 9:54 ` Peter Lieven
0 siblings, 1 reply; 3+ messages in thread
From: Peter Maydell @ 2014-09-02 9:36 UTC (permalink / raw)
To: Peter Lieven; +Cc: QEMU Developers, Gerd Hoffmann
On 2 September 2014 10:21, Peter Lieven <pl@kamp.de> 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 <pl@kamp.de>
> ---
> 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() ?
thanks
-- PMM
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] ui/vnc: set TCP_NODELAY
2014-09-02 9:36 ` Peter Maydell
@ 2014-09-02 9:54 ` Peter Lieven
0 siblings, 0 replies; 3+ messages in thread
From: Peter Lieven @ 2014-09-02 9:54 UTC (permalink / raw)
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 <pl@kamp.de> 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 <pl@kamp.de>
>> ---
>> 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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-09-02 9:54 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-02 9:21 [Qemu-devel] [PATCH] ui/vnc: set TCP_NODELAY Peter Lieven
2014-09-02 9:36 ` Peter Maydell
2014-09-02 9:54 ` Peter Lieven
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).