mirror of
https://github.com/esiur/esiur-dart.git
synced 2025-05-06 20:02:59 +00:00
Connection Status
This commit is contained in:
parent
51ecac1c55
commit
3dcf653e4d
5
lib/src/Net/IIP/ConnectionStatus.dart
Normal file
5
lib/src/Net/IIP/ConnectionStatus.dart
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
enum ConnectionStatus{
|
||||||
|
Closed,
|
||||||
|
Connecting,
|
||||||
|
Connected
|
||||||
|
}
|
@ -25,6 +25,7 @@ SOFTWARE.
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:collection/collection.dart';
|
import 'package:collection/collection.dart';
|
||||||
|
import 'ConnectionStatus.dart';
|
||||||
|
|
||||||
import '../../Data/IntType.dart';
|
import '../../Data/IntType.dart';
|
||||||
|
|
||||||
@ -279,7 +280,10 @@ class DistributedConnection extends NetworkConnection with IStore {
|
|||||||
if (_openReply != null)
|
if (_openReply != null)
|
||||||
throw AsyncException(ErrorType.Exception, 0, "Connection in progress");
|
throw AsyncException(ErrorType.Exception, 0, "Connection in progress");
|
||||||
|
|
||||||
|
status = ConnectionStatus.Connecting;
|
||||||
|
|
||||||
_openReply = new AsyncReply<bool>();
|
_openReply = new AsyncReply<bool>();
|
||||||
|
|
||||||
//print("_openReply hash ${_openReply.hashCode}");
|
//print("_openReply hash ${_openReply.hashCode}");
|
||||||
|
|
||||||
if (hostname != null) {
|
if (hostname != null) {
|
||||||
@ -339,6 +343,7 @@ class DistributedConnection extends NetworkConnection with IStore {
|
|||||||
// clean up
|
// clean up
|
||||||
_ready = false;
|
_ready = false;
|
||||||
_readyToEstablish = false;
|
_readyToEstablish = false;
|
||||||
|
status = ConnectionStatus.Closed;
|
||||||
|
|
||||||
//print("Disconnected ..");
|
//print("Disconnected ..");
|
||||||
|
|
||||||
@ -1062,6 +1067,7 @@ class DistributedConnection extends NetworkConnection with IStore {
|
|||||||
..done();
|
..done();
|
||||||
|
|
||||||
_ready = true;
|
_ready = true;
|
||||||
|
status = ConnectionStatus.Connected;
|
||||||
|
|
||||||
_openReply?.trigger(true);
|
_openReply?.trigger(true);
|
||||||
_openReply = null;
|
_openReply = null;
|
||||||
@ -1128,6 +1134,7 @@ class DistributedConnection extends NetworkConnection with IStore {
|
|||||||
_session?.id = _authPacket.sessionId;
|
_session?.id = _authPacket.sessionId;
|
||||||
|
|
||||||
_ready = true;
|
_ready = true;
|
||||||
|
status = ConnectionStatus.Connected;
|
||||||
|
|
||||||
_openReply?.trigger(true);
|
_openReply?.trigger(true);
|
||||||
_openReply = null;
|
_openReply = null;
|
||||||
@ -3150,6 +3157,8 @@ class DistributedConnection extends NetworkConnection with IStore {
|
|||||||
..done();
|
..done();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ConnectionStatus status = ConnectionStatus.Closed;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
getProperty(String name) => null;
|
getProperty(String name) => null;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user