ui/vnc: set TCP_NODELAY
PATCH 1/1 ui/vnc: set TCP_NODELAY
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.
--- ui/vnc.c | 4 ++++ 1 file changed, 4 insertions(+)
ui/vnc.c +4 -0
@@ -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); } }
Signature · 1 line
1.7.9.5
Quoted 18 lines · Peter Lieven
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_NODELAYas 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 <[email protected]>--- ui/vnc.c | 4 ++++ 1 file changed, 4 insertions(+)ui/vnc.c +0
-0
ui/vnc.c static void vnc_listen_read(void *opaque, bool websocket) · line 2892
Quoted 8 lines
ui/vnc.c +4
-0@@ -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
Quoted 21 lines · Peter Maydell
Quoted 20 lines · Peter Lieven
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_NODELAYas 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 <[email protected]>--- ui/vnc.c | 4 ++++ 1 file changed, 4 insertions(+)ui/vnc.c +0
-0@@ -2885,6 +2885,10 @@ static void vnc_listen_read(void *opaque, bool websocket) }
Quoted 7 lines
ui/vnc.c static void vnc_listen_read(void *opaque, bool websocket) · line 2892
Quoted 6 lines
ui/vnc.c +4
-0if (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
Quoted 3 lines
thanks
-- PMM