@pmpaq,
Thanks. This is a big help. I made good progress over the weekend, and will post back here when I have something working. I've run into a glitch handling signals (for example, a Ctrl-C, to exit from an endless loop). I'm going to report it in another thread so as not to hijack this one...