case 0:
// child
{
+ try
{
- socket_server ss("./socket");
- command_server cs(ss);
-
- // handle new connection and just one command
- cs.handle(10000000);
- cs.handle(10000000);
- }
- // close socket, create new one
+ {
+ socket_server ss("./socket");
+ command_server cs(ss);
+
+ // handle new connection and just one command
+ cs.handle(10000000);
+ cs.handle(10000000);
+ }
+ // close socket, create new one
+ {
+ socket_server ss("./socket");
+ ss.set_logging(&cerr,debug);
+ command_server cs(ss);
+
+ // max 30 sec
+ for (int i=0; i < 30; i++)
+ cs.handle(1000000);
+ }
+ } catch(...)
{
- socket_server ss("./socket");
- ss.set_logging(&cerr,debug);
- command_server cs(ss);
-
- // max 30 sec
- for (int i=0; i < 30; i++)
- cs.handle(1000000);
+ std::cerr << "exception in child. ignoring\n";
}
// don't call atexit and stuff