mirror of
https://github.com/2dust/v2rayN.git
synced 2025-05-02 13:18:50 +00:00
In tun mode, do a delay check and restart the core
This commit is contained in:
parent
2a37a6a28e
commit
e7b2deb941
1 changed files with 20 additions and 0 deletions
|
@ -1,5 +1,6 @@
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
using System.Reactive.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using v2rayN.Mode;
|
using v2rayN.Mode;
|
||||||
using v2rayN.Resx;
|
using v2rayN.Resx;
|
||||||
|
@ -45,6 +46,25 @@ namespace v2rayN.Handler
|
||||||
ShowMsg(true, $"{node.GetSummary()}");
|
ShowMsg(true, $"{node.GetSummary()}");
|
||||||
CoreStop();
|
CoreStop();
|
||||||
CoreStart(node);
|
CoreStart(node);
|
||||||
|
|
||||||
|
//In tun mode, do a delay check and restart the core
|
||||||
|
if (_config.tunModeItem.enableTun)
|
||||||
|
{
|
||||||
|
Observable.Range(1, 1)
|
||||||
|
.Delay(TimeSpan.FromSeconds(15))
|
||||||
|
.Subscribe(x =>
|
||||||
|
{
|
||||||
|
{
|
||||||
|
if (_process == null || _process.HasExited)
|
||||||
|
{
|
||||||
|
CoreStart(node);
|
||||||
|
ShowMsg(false, "Tun mode restart the core once");
|
||||||
|
Utils.SaveLog("Tun mode restart the core once");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue