|
|
@ -103,9 +103,8 @@ namespace v2rayN.Handler
|
|
|
|
{
|
|
|
|
{
|
|
|
|
try
|
|
|
|
try
|
|
|
|
{
|
|
|
|
{
|
|
|
|
for (int k = 0; k < _selecteds.Count; k++)
|
|
|
|
foreach (int index in _selecteds)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
int index = _selecteds[k];
|
|
|
|
|
|
|
|
if (_config.vmess[index].configType == (int)EConfigType.Custom)
|
|
|
|
if (_config.vmess[index].configType == (int)EConfigType.Custom)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
@ -121,7 +120,7 @@ namespace v2rayN.Handler
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Thread.Sleep(100);
|
|
|
|
Thread.Sleep(10);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch (Exception ex)
|
|
|
|
catch (Exception ex)
|
|
|
@ -262,8 +261,14 @@ namespace v2rayN.Handler
|
|
|
|
var timer = new Stopwatch();
|
|
|
|
var timer = new Stopwatch();
|
|
|
|
timer.Start();
|
|
|
|
timer.Start();
|
|
|
|
|
|
|
|
|
|
|
|
Socket clientSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
|
|
|
|
var endPoint = new IPEndPoint(ipAddress, port);
|
|
|
|
clientSocket.Connect(new IPEndPoint(ipAddress, port));
|
|
|
|
Socket clientSocket = new Socket(endPoint.AddressFamily, SocketType.Stream, ProtocolType.Tcp);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
IAsyncResult result = clientSocket.BeginConnect(endPoint, null, null);
|
|
|
|
|
|
|
|
if (!result.AsyncWaitHandle.WaitOne(TimeSpan.FromSeconds(5)))
|
|
|
|
|
|
|
|
throw new TimeoutException("connect timeout (5s): " + url);
|
|
|
|
|
|
|
|
clientSocket.EndConnect(result);
|
|
|
|
|
|
|
|
|
|
|
|
timer.Stop();
|
|
|
|
timer.Stop();
|
|
|
|
responseTime = timer.Elapsed.Milliseconds;
|
|
|
|
responseTime = timer.Elapsed.Milliseconds;
|
|
|
|
clientSocket.Close();
|
|
|
|
clientSocket.Close();
|
|
|
|