I'm working on a DRb-based, Internet-enabled ruby-processing server, intended to be run with "rp5 live" (so you can live code with others). My current problem is that I can't seem to execute code to disconnect from the server when the Processing::App subclass quits. I've tried overriding stop() and close(); neither seems to get called. I've even tried key_pressed(event) and disconnecting if event.key_code == 27 (Escape), but that then seems to prevent Escape from closing the window (as it normally does).
Is there a recommended way to run code on exit? A kludge I can use?