reference-containing struct that vanishes on the return of your corresponding function
I do not think it's a problem, otherwise **both programs would not work at all**.
However, echo-server works without any surprises; echo-client also works, except that EventSources pointed by sg0 and sg1 data members in the Stopper instance, are cleared by GC soon after echo-client start. This does not mean that echo-client gets SIGSEGV right after those objects are destroyed, no - the crash happens later, upon receiving SIGINT or SIGTERM.