1
This commit is contained in:
@@ -463,9 +463,9 @@ namespace BITKit.Net
|
||||
|
||||
while (true)
|
||||
{
|
||||
if ((_now - startTime).TotalSeconds > 5 || IsConnected is false)
|
||||
if ((_now - startTime).TotalSeconds > 5)
|
||||
{
|
||||
//await BITApp.SwitchToMainThread();
|
||||
await BITApp.SwitchToMainThread();
|
||||
if (string.IsNullOrEmpty(path))
|
||||
{
|
||||
throw new TimeoutException("请求超时或已断开连接");
|
||||
|
@@ -80,7 +80,7 @@ namespace BITKit.Net
|
||||
{
|
||||
server.Send(id,_heartBeat , KcpChannel.Unreliable);
|
||||
if (!_lastHeartbeat.TryGetValue(id, out var time)) continue;
|
||||
if (!((_now - time).TotalSeconds > 1)) continue;
|
||||
if (!((_now - time).TotalSeconds > 3)) continue;
|
||||
server.Disconnect(id);
|
||||
_lastHeartbeat.TryRemove(id);
|
||||
BIT4Log.Log<KCPNetServer>($"{Name}:链接{id}超时,已断开");
|
||||
|
Reference in New Issue
Block a user