X-Git-Url: http://developer.intra2net.com/git/?p=libt2n;a=blobdiff_plain;f=test%2Fnewserver.cpp;h=369d635ccd73a19ee223387ff4a4510f15529c66;hp=59aa6ae4fa672494daaf16b5218de6524bd322ec;hb=441d41fe583765902aa2f9641c0977e295e62be3;hpb=696c95c2808d6f88df2b348f9e77fc66c9068976 diff --git a/test/newserver.cpp b/test/newserver.cpp index 59aa6ae..369d635 100644 --- a/test/newserver.cpp +++ b/test/newserver.cpp @@ -138,23 +138,29 @@ class test_newserver : public TestFixture 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