diff --git a/lib/src/Net/IIP/ConnectionStatus.dart b/lib/src/Net/IIP/ConnectionStatus.dart new file mode 100644 index 0000000..b7c4dee --- /dev/null +++ b/lib/src/Net/IIP/ConnectionStatus.dart @@ -0,0 +1,5 @@ +enum ConnectionStatus{ + Closed, + Connecting, + Connected +} \ No newline at end of file diff --git a/lib/src/Net/IIP/DistributedConnection.dart b/lib/src/Net/IIP/DistributedConnection.dart index 87d7e8e..f6b0ece 100644 --- a/lib/src/Net/IIP/DistributedConnection.dart +++ b/lib/src/Net/IIP/DistributedConnection.dart @@ -25,6 +25,7 @@ SOFTWARE. import 'dart:async'; import 'package:collection/collection.dart'; +import 'ConnectionStatus.dart'; import '../../Data/IntType.dart'; @@ -279,7 +280,10 @@ class DistributedConnection extends NetworkConnection with IStore { if (_openReply != null) throw AsyncException(ErrorType.Exception, 0, "Connection in progress"); + status = ConnectionStatus.Connecting; + _openReply = new AsyncReply(); + //print("_openReply hash ${_openReply.hashCode}"); if (hostname != null) { @@ -339,6 +343,7 @@ class DistributedConnection extends NetworkConnection with IStore { // clean up _ready = false; _readyToEstablish = false; + status = ConnectionStatus.Closed; //print("Disconnected .."); @@ -1062,6 +1067,7 @@ class DistributedConnection extends NetworkConnection with IStore { ..done(); _ready = true; + status = ConnectionStatus.Connected; _openReply?.trigger(true); _openReply = null; @@ -1128,6 +1134,7 @@ class DistributedConnection extends NetworkConnection with IStore { _session?.id = _authPacket.sessionId; _ready = true; + status = ConnectionStatus.Connected; _openReply?.trigger(true); _openReply = null; @@ -3150,6 +3157,8 @@ class DistributedConnection extends NetworkConnection with IStore { ..done(); } + ConnectionStatus status = ConnectionStatus.Closed; + @override getProperty(String name) => null;