2
0
mirror of https://github.com/esiur/esiur-dotnet.git synced 2025-06-27 13:33:13 +00:00

ConnectionStatus

This commit is contained in:
2022-08-14 21:54:51 +03:00
parent f4d5eb0fdd
commit 2f379732ae
3 changed files with 27 additions and 2 deletions

View File

@ -111,6 +111,9 @@ public partial class DistributedConnection : NetworkConnection, IStore
/// </summary>
public DistributedServer Server { get; internal set; }
[Public] public virtual ConnectionStatus Status { get; set; }
public bool Remove(IResource resource)
{
// nothing to do
@ -1012,6 +1015,7 @@ public partial class DistributedConnection : NetworkConnection, IStore
Warehouse.Put(this.RemoteUsername, this, null, Server).Then(x =>
{
ready = true;
Status = ConnectionStatus.Connected;
openReply?.Trigger(true);
openReply = null;
OnReady?.Invoke(this);
@ -1029,6 +1033,8 @@ public partial class DistributedConnection : NetworkConnection, IStore
else
{
ready = true;
Status = ConnectionStatus.Connected;
openReply?.Trigger(true);
openReply = null;
@ -1123,6 +1129,8 @@ public partial class DistributedConnection : NetworkConnection, IStore
session.Id = authPacket.SessionId;
ready = true;
Status = ConnectionStatus.Connected;
// put it in the warehouse
if (this.Instance == null)
@ -1277,6 +1285,8 @@ public partial class DistributedConnection : NetworkConnection, IStore
if (openReply != null)
throw new AsyncException(ErrorType.Exception, 0, "Connection in progress");
Status = ConnectionStatus.Connecting;
openReply = new AsyncReply<bool>();
if (hostname != null)
@ -1485,7 +1495,9 @@ public partial class DistributedConnection : NetworkConnection, IStore
protected override void Disconencted()
{
// clean up
ready = false;
readyToEstablish = false;
Status = ConnectionStatus.Closed;
keepAliveTimer.Stop();
@ -1566,7 +1578,6 @@ public partial class DistributedConnection : NetworkConnection, IStore
attachedResources.Clear();
ready = false;
}
/*