Cleaning up some test programs: wait until connections have been established before entering loop.