捕捉到未处理错误打开日志

减少TUN/TAP设置路由表代码
日志细节优化
This commit is contained in:
ChsBuffer
2020-07-28 16:10:26 +08:00
parent b6a3f5bc36
commit c9396bd6b2
13 changed files with 240 additions and 352 deletions

View File

@@ -38,6 +38,7 @@ namespace Netch.Controllers
/// <returns>是否启动成功</returns>
public bool Start(Server server, Mode mode)
{
Logging.Info($"启动主控制器: {server.Type} [{mode.Type}]{mode.Remark}");
FlushDNSResolverCache();
var result = false;
@@ -90,7 +91,6 @@ namespace Netch.Controllers
if (result)
{
Logging.Info("加密代理已启动");
switch (mode.Type)
{
case 0: // 进程代理模式
@@ -136,7 +136,11 @@ namespace Netch.Controllers
}
}
if (!result) Stop();
if (!result)
{
Logging.Error("主控制器启动失败");
Stop();
}
return result;
}