删除调试代码...

This commit is contained in:
2248356998 qq.com
2023-05-22 17:09:21 +08:00
parent e0f24c795c
commit 86282f596c

View File

@@ -536,10 +536,6 @@ namespace TouchSocket.Sockets
using CancellationTokenSource cancellationTokenSource = new();
var task = this.MainSocket.ConnectAsync(iPHost.EndPoint, cancellationTokenSource.Token).AsTask();
var result = await Task.WhenAny(task, Task.Delay(timeout, cancellationTokenSource.Token));
if (DateTime.UtcNow - nowTime < TimeSpan.FromMilliseconds(timeout))
{
await Task.Delay(500);
}
if (result == task)
{
cancellationTokenSource.Cancel();
@@ -562,10 +558,6 @@ namespace TouchSocket.Sockets
using CancellationTokenSource cancellationTokenSource = new();
var task = Task.Factory.FromAsync(this.MainSocket.BeginConnect(iPHost.EndPoint, null, null), this.MainSocket.EndConnect);
var result = await Task.WhenAny(task, Task.Delay(timeout, cancellationTokenSource.Token));
if (DateTime.UtcNow - nowTime < TimeSpan.FromMilliseconds(timeout))
{
await Task.Delay(500);
}
if (result == task)
{
cancellationTokenSource.Cancel();