mirror of https://github.com/2dust/v2rayN
In tun mode, do a delay check and restart the core
parent
2a37a6a28e
commit
e7b2deb941
|
@ -1,5 +1,6 @@
|
|||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Reactive.Linq;
|
||||
using System.Text;
|
||||
using v2rayN.Mode;
|
||||
using v2rayN.Resx;
|
||||
|
@ -45,6 +46,25 @@ namespace v2rayN.Handler
|
|||
ShowMsg(true, $"{node.GetSummary()}");
|
||||
CoreStop();
|
||||
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 New Issue