Summary: | Add keepalive on different channel | ||
---|---|---|---|
Product: | Spice | Reporter: | prochazka.nicolas |
Component: | spice-gtk | Assignee: | Spice Bug List <spice-bugs> |
Status: | RESOLVED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | medium | ||
Version: | unspecified | ||
Hardware: | Other | ||
OS: | All | ||
Whiteboard: | |||
i915 platform: | i915 features: |
Description
prochazka.nicolas
2012-02-10 08:37:27 UTC
I guess setting g_socket_set_keepalive (channel_socket, TRUE) should be enough. Would you be kind enough to make a patch and try it? thanks a lot I'm trying some dev without success. I add g_socket_set_keepalive (c->sock, TRUE); in spice-session.c and spice-channel.c but keepalive not set. So I do a LD_PRELOAD wrapper to keepalive all socket, without success with spicy but succes with socat Any help ? 1 / socat - TCP4:10.10.4.226:5930 tcp 0 0 192.150.23.165:32968 10.10.4.226:5930 ESTABLISHED 0 72551 3361/socat off (0.00/0/0) 2 / LD_PRELOAD=/tmp/keepalive.so socat - TCP4:10.10.4.226:5930 tcp 0 0 192.150.23.165:32964 10.10.4.226:5930 ESTABLISHED 0 72354 3357/socat keepalive (9.45/0/0) 1/spicy -h 10.10.4.226 -p 5930 tcp 0 0 192.150.23.165:32959 10.10.4.226:5930 ESTABLISHED 0 72233 3351/spicy off (0.00/0/0) ( 6 lines ) LD_PRELOAD=/tmp/keepalive.so spicy -h 10.10.4.226 -p 5930 tcp 0 0 192.150.23.165:32959 10.10.4.226:5930 ESTABLISHED 0 72233 3351/spicy off (0.00/0/0) ( 6 lines ) as marc andre says, just set keepalive flag resolved this issue. Thanks. Nicolas. diff --git a/spice-gtk-0.9/gtk/spice-channel.c b/tmp/spice-gtk-0.9/gtk/spice-channel.c index bdfb02b..49c69c9 100644 --- a/spice-gtk-0.9/gtk/spice-channel.c +++ b/tmp/spice-gtk-0.9/gtk/spice-channel.c @@ -2096,6 +2096,7 @@ static void *spice_channel_coroutine(void *data) } g_socket_set_blocking(c->sock, FALSE); + g_socket_set_keepalive(c->sock, TRUE); goto connected; } diff --git a/spice-gtk-0.9/gtk/spice-session.c b/tmp/spice-gtk-0.9/gtk/spice-session.c index 33c297a..0156f94 100644 --- a/spice-gtk-0.9/gtk/spice-session.c +++ b/tmp/spice-gtk-0.9/gtk/spice-session.c @@ -1417,6 +1417,7 @@ static GSocket *channel_connect_socket(SpiceChannel *channel, return NULL; g_socket_set_blocking(sock, FALSE); + g_socket_set_keepalive(sock, TRUE); if (!g_socket_connect(sock, sockaddr, NULL, error)) { if (*error && (*error)->code == G_IO_ERROR_PENDING) { g_clear_error(error); |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.