mirror of
https://github.com/esiur/esiur-dotnet.git
synced 2025-05-06 11:32:59 +00:00
Fix
This commit is contained in:
parent
21a2061fc4
commit
f4d5eb0fdd
@ -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
|
||||
{
|
||||
|
@ -708,13 +708,11 @@ partial class DistributedConnection
|
||||
{
|
||||
if (res != null)
|
||||
{
|
||||
//var r = res as IResource;
|
||||
//r.Instance.ResourceEventOccurred -= Instance_EventOccurred;
|
||||
//r.Instance.CustomResourceEventOccurred -= Instance_CustomEventOccurred;
|
||||
//r.Instance.ResourceModified -= Instance_PropertyModified;
|
||||
//r.Instance.ResourceDestroyed -= Instance_ResourceDestroyed;
|
||||
|
||||
|
||||
// unsubscribe
|
||||
Unsubscribe(res);
|
||||
// remove from cache
|
||||
cache.Remove(res);
|
||||
|
||||
// remove from attached resources
|
||||
//attachedResources.Remove(res);
|
||||
|
@ -149,19 +149,16 @@ public class DistributedServer : NetworkServer<DistributedConnection>, IResource
|
||||
// base.AddConnection(connection);
|
||||
//}
|
||||
|
||||
bool one = false;
|
||||
|
||||
protected override void ClientConnected(DistributedConnection connection)
|
||||
{
|
||||
// if (!one)
|
||||
//connection.OnReady += ConnectionReadyEventReceiver;
|
||||
Task.Delay(10000).ContinueWith((x) =>
|
||||
{
|
||||
Console.WriteLine("By bye");
|
||||
// Remove me from here
|
||||
connection.Close();
|
||||
one = true;
|
||||
});
|
||||
//Task.Delay(10000).ContinueWith((x) =>
|
||||
//{
|
||||
// Console.WriteLine("By bye");
|
||||
// // Remove me from here
|
||||
// connection.Close();
|
||||
// one = true;
|
||||
//});
|
||||
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,2 @@
|
||||
1- Change branch to main
|
||||
2- Generic Records/Resources
|
||||
3- Static functions calls
|
||||
4- Scan assembly for child classes
|
||||
1- Scan assembly for child classes
|
||||
2- Auto reconnect id
|
Loading…
x
Reference in New Issue
Block a user