|
@@ -626,7 +626,24 @@ struct main_loop:io_context
|
|
|
|
|
|
block_sig(SIGPIPE);
|
|
|
signal_w sint(*this,SIGINT),term(*this,SIGTERM);
|
|
|
- ev::dynamic_loop::run(0);
|
|
|
+
|
|
|
+
|
|
|
+ while(!check_stop_flag())
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+ ev::dynamic_loop::run(0);
|
|
|
+ }
|
|
|
+ catch(const std::exception&e)
|
|
|
+ {
|
|
|
+ log_error("捕获到异常:%s",e.what());
|
|
|
+ }
|
|
|
+ catch(...)
|
|
|
+ {
|
|
|
+ log_error("捕获到未知异常");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
_1.stop();
|
|
|
close_all();
|
|
|
|