Skip to content

Commit

Permalink
In tun mode, do a delay check and restart the core
Browse files Browse the repository at this point in the history
  • Loading branch information
2dust committed Nov 22, 2023
1 parent 2a37a6a commit e7b2deb
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions v2rayN/v2rayN/Handler/CoreHandler.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Diagnostics;
using System.IO;
using System.Reactive.Linq;
using System.Text;
using v2rayN.Mode;
using v2rayN.Resx;
Expand Down Expand Up @@ -45,6 +46,25 @@ public void LoadCore()
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");
}
}
});
}
}
}

Expand Down

0 comments on commit e7b2deb

Please sign in to comment.