I haven't tried it in C++, but in python I usually do something like: try: server.serve() except SystemExit: #SIGINT sys.exit(0) except Exception as e: #Something else... sys.exit(1)
I suppose you can listen on SIGINT and raise an exception or something through the signal handler. On Sat, Oct 23, 2010 at 7:21 AM, Richard Salz <[email protected]> wrote: > When a server is in its "serve" loop: > server.serve() > printf("Exiting..\n"); > > What't the right way to make that stop and return so the printf happens? I > thought having having SIGTERM call server.stop(), but apparently not. What > should I do? > > /r$ > > -- > STSM, WebSphere Appliance Architect > https://www.ibm.com/developerworks/mydeveloperworks/blogs/soma/ > >
