mirror of https://github.com/2dust/v2rayN
整合函数
parent
b6d1c4330f
commit
1922f30f0f
|
@ -51,18 +51,7 @@ namespace v2rayN.Handler
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Close()
|
private void RunPingSub(Action<int> updateFun)
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
Utils.SaveLog(ex.Message, ex);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void RunPing()
|
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -74,38 +63,7 @@ namespace v2rayN.Handler
|
||||||
}
|
}
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
long time = Utils.Ping(_config.vmess[index].address);
|
updateFun(index);
|
||||||
_updateFunc(index, string.Format("{0}ms", time));
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
Utils.SaveLog(ex.Message, ex);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Thread.Sleep(100);
|
|
||||||
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
Utils.SaveLog(ex.Message, ex);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void RunTcping()
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
foreach (int index in _selecteds)
|
|
||||||
{
|
|
||||||
if (_config.vmess[index].configType == (int)EConfigType.Custom)
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
try
|
|
||||||
{
|
|
||||||
var time = GetTcpingTime(_config.vmess[index].address, _config.vmess[index].port);
|
|
||||||
_updateFunc(index, string.Format("{0}ms", time));
|
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
@ -114,7 +72,6 @@ namespace v2rayN.Handler
|
||||||
}
|
}
|
||||||
|
|
||||||
Thread.Sleep(10);
|
Thread.Sleep(10);
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
@ -122,6 +79,25 @@ namespace v2rayN.Handler
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void RunPing()
|
||||||
|
{
|
||||||
|
RunPingSub((int index) =>
|
||||||
|
{
|
||||||
|
long time = Utils.Ping(_config.vmess[index].address);
|
||||||
|
_updateFunc(index, string.Format("{0}ms", time));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void RunTcping()
|
||||||
|
{
|
||||||
|
RunPingSub((int index) =>
|
||||||
|
{
|
||||||
|
int time = GetTcpingTime(_config.vmess[index].address, _config.vmess[index].port);
|
||||||
|
_updateFunc(index, string.Format("{0}ms", time));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
private void RunRealPing()
|
private void RunRealPing()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
|
Loading…
Reference in New Issue