thrift-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dvir Volk <dvir...@gmail.com>
Subject Re: stop() method?
Date Sat, 23 Oct 2010 16:49:04 GMT
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 <rsalz@us.ibm.com> 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/
>
>

Mime
View raw message