mirror of
https://github.com/esiur/esiur-dotnet.git
synced 2025-05-07 12:02:59 +00:00
ConnectionStatus
This commit is contained in:
parent
f4d5eb0fdd
commit
2f379732ae
@ -6,7 +6,7 @@
|
|||||||
<Copyright>Ahmed Kh. Zamil</Copyright>
|
<Copyright>Ahmed Kh. Zamil</Copyright>
|
||||||
<PackageProjectUrl>http://www.esiur.com</PackageProjectUrl>
|
<PackageProjectUrl>http://www.esiur.com</PackageProjectUrl>
|
||||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||||
<Version>2.2.6.2</Version>
|
<Version>2.2.7</Version>
|
||||||
<RepositoryUrl>https://github.com/esiur/esiur-dotnet</RepositoryUrl>
|
<RepositoryUrl>https://github.com/esiur/esiur-dotnet</RepositoryUrl>
|
||||||
<Authors>Ahmed Kh. Zamil</Authors>
|
<Authors>Ahmed Kh. Zamil</Authors>
|
||||||
<AssemblyVersion></AssemblyVersion>
|
<AssemblyVersion></AssemblyVersion>
|
||||||
|
14
Esiur/Net/IIP/ConnectionStatus.cs
Normal file
14
Esiur/Net/IIP/ConnectionStatus.cs
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace Esiur.Net.IIP
|
||||||
|
{
|
||||||
|
public enum ConnectionStatus
|
||||||
|
{
|
||||||
|
Closed,
|
||||||
|
Connecting,
|
||||||
|
Connected
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -111,6 +111,9 @@ public partial class DistributedConnection : NetworkConnection, IStore
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public DistributedServer Server { get; internal set; }
|
public DistributedServer Server { get; internal set; }
|
||||||
|
|
||||||
|
|
||||||
|
[Public] public virtual ConnectionStatus Status { get; set; }
|
||||||
|
|
||||||
public bool Remove(IResource resource)
|
public bool Remove(IResource resource)
|
||||||
{
|
{
|
||||||
// nothing to do
|
// nothing to do
|
||||||
@ -1012,6 +1015,7 @@ public partial class DistributedConnection : NetworkConnection, IStore
|
|||||||
Warehouse.Put(this.RemoteUsername, this, null, Server).Then(x =>
|
Warehouse.Put(this.RemoteUsername, this, null, Server).Then(x =>
|
||||||
{
|
{
|
||||||
ready = true;
|
ready = true;
|
||||||
|
Status = ConnectionStatus.Connected;
|
||||||
openReply?.Trigger(true);
|
openReply?.Trigger(true);
|
||||||
openReply = null;
|
openReply = null;
|
||||||
OnReady?.Invoke(this);
|
OnReady?.Invoke(this);
|
||||||
@ -1029,6 +1033,8 @@ public partial class DistributedConnection : NetworkConnection, IStore
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
ready = true;
|
ready = true;
|
||||||
|
Status = ConnectionStatus.Connected;
|
||||||
|
|
||||||
openReply?.Trigger(true);
|
openReply?.Trigger(true);
|
||||||
openReply = null;
|
openReply = null;
|
||||||
|
|
||||||
@ -1123,6 +1129,8 @@ public partial class DistributedConnection : NetworkConnection, IStore
|
|||||||
session.Id = authPacket.SessionId;
|
session.Id = authPacket.SessionId;
|
||||||
|
|
||||||
ready = true;
|
ready = true;
|
||||||
|
Status = ConnectionStatus.Connected;
|
||||||
|
|
||||||
// put it in the warehouse
|
// put it in the warehouse
|
||||||
|
|
||||||
if (this.Instance == null)
|
if (this.Instance == null)
|
||||||
@ -1277,6 +1285,8 @@ public partial class DistributedConnection : NetworkConnection, IStore
|
|||||||
if (openReply != null)
|
if (openReply != null)
|
||||||
throw new AsyncException(ErrorType.Exception, 0, "Connection in progress");
|
throw new AsyncException(ErrorType.Exception, 0, "Connection in progress");
|
||||||
|
|
||||||
|
Status = ConnectionStatus.Connecting;
|
||||||
|
|
||||||
openReply = new AsyncReply<bool>();
|
openReply = new AsyncReply<bool>();
|
||||||
|
|
||||||
if (hostname != null)
|
if (hostname != null)
|
||||||
@ -1485,7 +1495,9 @@ public partial class DistributedConnection : NetworkConnection, IStore
|
|||||||
protected override void Disconencted()
|
protected override void Disconencted()
|
||||||
{
|
{
|
||||||
// clean up
|
// clean up
|
||||||
|
ready = false;
|
||||||
readyToEstablish = false;
|
readyToEstablish = false;
|
||||||
|
Status = ConnectionStatus.Closed;
|
||||||
|
|
||||||
keepAliveTimer.Stop();
|
keepAliveTimer.Stop();
|
||||||
|
|
||||||
@ -1566,7 +1578,6 @@ public partial class DistributedConnection : NetworkConnection, IStore
|
|||||||
|
|
||||||
attachedResources.Clear();
|
attachedResources.Clear();
|
||||||
|
|
||||||
ready = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user