2
0
mirror of https://github.com/esiur/esiur-dotnet.git synced 2025-06-27 13:33:13 +00:00
This commit is contained in:
2022-08-13 04:02:21 +03:00
parent 21a2061fc4
commit f4d5eb0fdd
4 changed files with 18 additions and 22 deletions

View File

@ -1213,6 +1213,9 @@ public partial class DistributedConnection : NetworkConnection, IStore
[Attribute]
public bool AutoReconnect { get; set; } = false;
[Attribute]
public uint ReconnectInterval { get; set; } = 5;
[Attribute]
public string Username { get; set; }
@ -1317,7 +1320,7 @@ public partial class DistributedConnection : NetworkConnection, IStore
if (AutoReconnect)
{
Console.Write("Reconnecting socket...");
Task.Delay(5000).ContinueWith((x) => connectSocket(socket));
Task.Delay((int)ReconnectInterval).ContinueWith((x) => connectSocket(socket));
}
else
{
@ -1553,7 +1556,7 @@ public partial class DistributedConnection : NetworkConnection, IStore
else if (AutoReconnect && !invalidCredentials)
{
// reconnect
Task.Delay(5000).ContinueWith((x) => Reconnect());
Task.Delay((int)ReconnectInterval).ContinueWith((x) => Reconnect());
}
else
{