xpra icon
Bug tracker and wiki

Opened 3 years ago

Last modified 4 months ago

#540 assigned enhancement

handle connection issues, session events, network drop outs, power events, etc

Reported by: Antoine Martin Owned by: Antoine Martin
Priority: minor Milestone: 2.1
Component: core Version:
Keywords: Cc:

Description (last modified by Antoine Martin)

Follow up from #492, greater scope than #401 and #493.

  • we should register for notification from the OS's network events, so we don't try to send packets if the network is down, and so we can re-connect if needed once the network is back up (was #493)
  • we should probably handle session logout or shutdown events and disconnect more gracefully from the server
  • we should probably also handle lower power states better, so that if the screen is being dimmed due to lack of activity, then we can slow down the refresh rate too (if not pause it completely)
  • detect screensaver activation, and go to suspend mode
    • for win32: *win32gui.SystemParametersInfo(win32con.SPI_GETSCREENSAVERRUNNING, None, 0) gives you the screensaver state
      • properly using session events: http://timgolden.me.uk/python/win32_how_do_i/track-session-events.html track session events
    • X11: X11 idle time and focused window in Python
  • it may also be useful to have those same event hooks on the server side: knowing that something is broken with the network would be useful in the logs and we could prevent unnecessary/unhelpful changes to speed,quality and batch settings when network problem occur
  • optional: when new interfaces come up, do we want to start publishing our mdns record on them?
  • if the client suspends then resumes, maybe we want to keep the connection alive longer (from #492):
    2014-03-20 13:42:21,933 system is suspending
    2014-03-20 13:42:24,628 server is not responding, drawing spinners over the windows
    2014-03-20 13:43:40,279 system resumed, was suspended for 0:01:18
    2014-03-20 13:43:40,358 WM_TIMECHANGE: time change event: 0 / 0
    2014-03-20 13:43:40,390 server ping timeout - waited 60 seconds without a response
    2014-03-20 13:43:41,920 Connection lost
    

In this case, the sleep was longer than 60 seconds, but if the TCP connection can be kept alive, why not keep it? (just suspend most of the work on the server until the underlying TCP connection breaks?)

Some links:

Change History (12)

comment:1 Changed 3 years ago by Antoine Martin

Description: modified (diff)

comment:2 Changed 3 years ago by Antoine Martin

Milestone: 0.130.14

comment:3 Changed 3 years ago by Antoine Martin

Description: modified (diff)
Owner: changed from Antoine Martin to Antoine Martin
Status: newassigned

comment:4 Changed 2 years ago by Antoine Martin

Milestone: 0.15future

re-scheduling, see also #978

Last edited 22 months ago by Antoine Martin (previous) (diff)

comment:5 Changed 20 months ago by Antoine Martin

Milestone: future0.17

comment:6 Changed 16 months ago by Antoine Martin

Milestone: 0.171.0

comment:7 Changed 15 months ago by Antoine Martin

For win32, found this: Waiting on an event when rendering is unnecessary in DXGI.
These two functions are Windows 8 and Platform Update for Windows 7 only (whatever that means):

For OSX, the power event handler is broken and causes crashes (now disabled): #924 / #1137.

Last edited 15 months ago by Antoine Martin (previous) (diff)

comment:8 Changed 12 months ago by Antoine Martin

Milestone: 1.01.1

Milestone renamed

comment:9 Changed 10 months ago by Antoine Martin

Milestone: 1.12.0

Milestone renamed

comment:10 Changed 9 months ago by Antoine Martin

For OSX, this function may be useful: CGDisplayIsAsleep: Returns a Boolean value indicating whether a display is sleeping (and is therefore not drawable.), but there doesn't seem to be any notifications for this one, so we would need to poll for it regularly.

comment:11 Changed 9 months ago by Antoine Martin

Milestone: 2.03.0

Related to #999 and #401

Last edited 4 months ago by Antoine Martin (previous) (diff)

comment:12 Changed 4 months ago by Antoine Martin

Milestone: 3.02.1
Note: See TracTickets for help on using tickets.