mirror of https://github.com/2dust/v2rayN
parent
c339aa349c
commit
201cfaa922
|
@ -5,6 +5,7 @@
|
|||
ClearMsg,
|
||||
SendMsgView,
|
||||
SendSnackMsg,
|
||||
RefreshProfiles
|
||||
RefreshProfiles,
|
||||
StopSpeedtest
|
||||
}
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
using System.Diagnostics;
|
||||
using ReactiveUI;
|
||||
using System.Diagnostics;
|
||||
using System.Net;
|
||||
using System.Net.Sockets;
|
||||
|
||||
namespace ServiceLib.Services
|
||||
{
|
||||
public class SpeedtestService
|
||||
|
@ -80,10 +80,12 @@ namespace ServiceLib.Services
|
|||
Task.Run(RunMixedtestAsync);
|
||||
break;
|
||||
}
|
||||
MessageBus.Current.Listen<string>(EMsgCommand.StopSpeedtest.ToString()).Subscribe(ExitLoop);
|
||||
}
|
||||
|
||||
public void ExitLoop()
|
||||
private void ExitLoop(string x)
|
||||
{
|
||||
if(_exitLoop) return;
|
||||
_exitLoop = true;
|
||||
UpdateFunc("", ResUI.SpeedtestingStop);
|
||||
}
|
||||
|
|
|
@ -16,7 +16,6 @@ namespace ServiceLib.ViewModels
|
|||
private List<ProfileItem> _lstProfile;
|
||||
private string _serverFilter = string.Empty;
|
||||
private Dictionary<string, bool> _dicHeaderSort = new();
|
||||
private SpeedtestService? _speedtestHandler;
|
||||
|
||||
#endregion private prop
|
||||
|
||||
|
@ -686,12 +685,13 @@ namespace ServiceLib.ViewModels
|
|||
}
|
||||
//ClearTestResult();
|
||||
|
||||
_speedtestHandler = new SpeedtestService(_config, lstSelecteds, actionType, UpdateSpeedtestHandler);
|
||||
_ = new SpeedtestService(_config, lstSelecteds, actionType, UpdateSpeedtestHandler);
|
||||
|
||||
}
|
||||
|
||||
public void ServerSpeedtestStop()
|
||||
{
|
||||
_speedtestHandler?.ExitLoop();
|
||||
MessageBus.Current.SendMessage("", EMsgCommand.StopSpeedtest.ToString());
|
||||
}
|
||||
|
||||
private async Task Export2ClientConfigAsync(bool blClipboard)
|
||||
|
|
Loading…
Reference in New Issue