I observed the following:
- rdesktop intentionally retries reading all the time
- if trying to read times out (after 60 seconds) it just tries again.
- if the network link went away long enough, it will try forever or at
least very long without getting data
- while retrying on a dead connection, the window doesn't react to any
input from either side, but it keeps focus and grabs the keyboard, which
is especially annoying in fullscreen.. This is what I want to change.
- data is always considered sent, even if the connection is broken? I
didn't have a closer look into this.
To fix this I created a patch, that counts 3 timeouts (All good things
come in threes. :-) ) and after this sets g_network_error to true. This
starts the reconnect loop where rdesktop tries to reestablish the
connection to the server.
WARNING: This will also trigger, if there simply is no data to be
received for 3 minutes, for example on an idle remote desktop without a
clock or anything moving!
It only triggers if we do NOT send any data. Moving the mouse is enough
to make rdesktop think it did send data! To trigger we need at least 3
minutes of absolutely nothing happening, no received data and no data sent.
So this patch is by no means perfect. But it seems to help in my case.
Some bugs I found describing the symptoms:
#347 and #345
I attached the patch to xwin.c.
Hopefully this helps anyone out there..
Do you have any ideas for enhancements?
From: Henrik Andersson <henrik.andersson@ce...> - 2014-06-23 06:41:19
On Wed, 18 Jun 2014 17:36:54 +0200
Lars Wenderoth <frozen@...> wrote:
> To fix this I created a patch, that counts 3 timeouts (All good things
> come in threes. :-) ) and after this sets g_network_error to true.
> This starts the reconnect loop where rdesktop tries to reestablish the
> connection to the server.
Nice work, the send/recv implementation within rdesktop is just poorly
designed and these issues should not exists at all.
I will definitly take a look at your patch to improve in this area of
Henrik Andersson (Cendio AB)