mirror of
				https://github.com/esiur/esiur-dart.git
				synced 2025-11-04 09:11:35 +00:00 
			
		
		
		
	1.2.2
This commit is contained in:
		@@ -1,3 +1,9 @@
 | 
				
			|||||||
 | 
					## [1.2.1] - Release.
 | 
				
			||||||
 | 
					Reconnect error handling
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					## [1.2.0] - Release.
 | 
				
			||||||
 | 
					Added resume connection
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## [1.1.9] - Release.
 | 
					## [1.1.9] - Release.
 | 
				
			||||||
Added new property event
 | 
					Added new property event
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -259,12 +259,8 @@ class DistributedConnection extends NetworkConnection with IStore
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Future<bool> reconnect() async
 | 
					    Future<bool> reconnect() async
 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
      try
 | 
					 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        if (await connect())
 | 
					        if (await connect())
 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
          try
 | 
					 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
          var bag = AsyncBag();
 | 
					          var bag = AsyncBag();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -277,21 +273,13 @@ class DistributedConnection extends NetworkConnection with IStore
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
          bag.seal();
 | 
					          bag.seal();
 | 
				
			||||||
          await bag;
 | 
					          await bag;
 | 
				
			||||||
          }
 | 
					 | 
				
			||||||
          catch(ex)
 | 
					 | 
				
			||||||
          {
 | 
					 | 
				
			||||||
            print(ex.toString());
 | 
					 | 
				
			||||||
          }
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
      }
 | 
					 | 
				
			||||||
      catch(ex)
 | 
					 | 
				
			||||||
      {
 | 
					 | 
				
			||||||
        return false;
 | 
					 | 
				
			||||||
      }
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
          return true;
 | 
					          return true;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
 | 
					        return false;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /// <summary>
 | 
					    /// <summary>
 | 
				
			||||||
    /// KeyList to store user variables related to this connection.
 | 
					    /// KeyList to store user variables related to this connection.
 | 
				
			||||||
    /// </summary>
 | 
					    /// </summary>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -220,6 +220,9 @@ class IIPPacket
 | 
				
			|||||||
                var cl = data.getUint32( offset);
 | 
					                var cl = data.getUint32( offset);
 | 
				
			||||||
                offset += 4;
 | 
					                offset += 4;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                if (_notEnough(offset, ends, cl))
 | 
				
			||||||
 | 
					                    return -_dataLengthNeeded;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                content = data.clip(offset, cl);
 | 
					                content = data.clip(offset, cl);
 | 
				
			||||||
                offset += cl;
 | 
					                offset += cl;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,6 +1,6 @@
 | 
				
			|||||||
name: esyur
 | 
					name: esyur
 | 
				
			||||||
description: Distributed Object Framework.
 | 
					description: Distributed Object Framework.
 | 
				
			||||||
version: 1.1.9
 | 
					version: 1.2.1
 | 
				
			||||||
# author: Ahmed Zamil <ahmed@dijlh.com>
 | 
					# author: Ahmed Zamil <ahmed@dijlh.com>
 | 
				
			||||||
homepage: https://github.com/esyur/esyur-dart
 | 
					homepage: https://github.com/esyur/esyur-dart
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -24,18 +24,23 @@ main() async
 | 
				
			|||||||
    print(x.suspended);
 | 
					    print(x.suspended);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    DistributedConnection con = x.connection;
 | 
					    DistributedConnection con = x.connection;
 | 
				
			||||||
    con.close();
 | 
					    //con.close();
 | 
				
			||||||
        print(x.suspended);
 | 
					        print(x.suspended);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
   now = DateTime.now();
 | 
					   now = DateTime.now();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    await con.reconnect();
 | 
					    //await con.reconnect();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    print("Time ${DateTime.now().difference(now).inSeconds}");
 | 
					    print("Time ${DateTime.now().difference(now).inSeconds}");
 | 
				
			||||||
    print(x.suspended);
 | 
					    print(x.suspended);
 | 
				
			||||||
    var u = await x.getMyTrackers();
 | 
					    var u = await x.getMyTrackers();
 | 
				
			||||||
    print(trackers[0].suspended);
 | 
					    print(trackers[0].suspended);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    u[0].on("moved", (x){
 | 
				
			||||||
 | 
					      print("Movvvvvvvvvvvvvvvvved");
 | 
				
			||||||
 | 
					    });
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					  Future.delayed(Duration(seconds: 100));
 | 
				
			||||||
  // for(var i = 0; i < trackers.length; i++)
 | 
					  // for(var i = 0; i < trackers.length; i++)
 | 
				
			||||||
  //   print(trackers[i].name);
 | 
					  //   print(trackers[i].name);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user