2
0
mirror of https://github.com/esiur/esiur-dart.git synced 2025-05-06 12:02:57 +00:00
This commit is contained in:
Ahmed Zamil 2020-03-25 08:53:53 +03:00
parent 09b010612a
commit 897ac180b7
5 changed files with 30 additions and 28 deletions

View File

@ -1,3 +1,9 @@
## [1.2.1] - Release.
Reconnect error handling
## [1.2.0] - Release.
Added resume connection
## [1.1.9] - Release.
Added new property event

View File

@ -260,36 +260,24 @@ class DistributedConnection extends NetworkConnection with IStore
Future<bool> reconnect() async
{
try
{
if (await connect())
{
try
{
var bag = AsyncBag();
var bag = AsyncBag();
for(var i = 0; i < _resources.keys.length; i++)
{
var index = _resources.keys.elementAt(i);
// print("Re $i ${_resources[index].instance.template.className}");
bag.add(fetch(index));
}
bag.seal();
await bag;
}
catch(ex)
for(var i = 0; i < _resources.keys.length; i++)
{
print(ex.toString());
var index = _resources.keys.elementAt(i);
// print("Re $i ${_resources[index].instance.template.className}");
bag.add(fetch(index));
}
bag.seal();
await bag;
return true;
}
}
catch(ex)
{
return false;
}
return true;
return false;
}
/// <summary>

View File

@ -220,6 +220,9 @@ class IIPPacket
var cl = data.getUint32( offset);
offset += 4;
if (_notEnough(offset, ends, cl))
return -_dataLengthNeeded;
content = data.clip(offset, cl);
offset += cl;

View File

@ -1,6 +1,6 @@
name: esyur
description: Distributed Object Framework.
version: 1.1.9
version: 1.2.1
# author: Ahmed Zamil <ahmed@dijlh.com>
homepage: https://github.com/esyur/esyur-dart

View File

@ -7,8 +7,8 @@ main() async
//test("Connect to server", () async {
// connect to the server
var x = await Warehouse.get("iip://localhost:5000/sys/su", {"username": "admin", "password": "1234"
, "domain": "example.com"});
var x = await Warehouse.get("iip://localhost:5000/sys/su", {"username": "admin", "password": "1234"
, "domain": "example.com"});
var now = DateTime.now();
@ -24,18 +24,23 @@ main() async
print(x.suspended);
DistributedConnection con = x.connection;
con.close();
//con.close();
print(x.suspended);
now = DateTime.now();
await con.reconnect();
//await con.reconnect();
print("Time ${DateTime.now().difference(now).inSeconds}");
print(x.suspended);
var u = await x.getMyTrackers();
print(trackers[0].suspended);
u[0].on("moved", (x){
print("Movvvvvvvvvvvvvvvvved");
});
Future.delayed(Duration(seconds: 100));
// for(var i = 0; i < trackers.length; i++)
// print(trackers[i].name);