diff --git a/lib/src/Data/DC.dart b/lib/src/Data/DC.dart index 5744b0d..9f3eae5 100644 --- a/lib/src/Data/DC.dart +++ b/lib/src/Data/DC.dart @@ -485,7 +485,7 @@ class DC with IterableMixin { //var h = this.getUint32(offset + 4); //return h * TWO_PWR_32 + ((l >= 0) ? l : TWO_PWR_32 + l); } else { - return _dv.getUint64(offset); + return _dv.getUint64(offset, endian); } } @@ -523,7 +523,7 @@ class DC with IterableMixin { //var h = this.getUint32(offset + 4); //return h * TWO_PWR_32 + ((l >= 0) ? l : TWO_PWR_32 + l); } else { - return _dv.getUint64(offset); + return _dv.getUint64(offset, endian); } // if (kIsWeb) { // print("getUint64"); diff --git a/lib/src/Net/IIP/DistributedConnection.dart b/lib/src/Net/IIP/DistributedConnection.dart index f6b0ece..ea5445d 100644 --- a/lib/src/Net/IIP/DistributedConnection.dart +++ b/lib/src/Net/IIP/DistributedConnection.dart @@ -224,6 +224,18 @@ class DistributedConnection extends NetworkConnection with IStore { var secure = instance?.attributes.containsKey("secure") == true || instance?.attributes.containsKey("wss") == true; + if (instance?.attributes.containsKey("autoReconnect") ?? false) + autoReconnect = instance?.attributes["autoReconnect"] == true; + + if (instance?.attributes.containsKey("reconnectInterval") ?? false) + reconnectInterval = instance?.attributes["reconnectInterval"]; + + if (instance?.attributes.containsKey("keepAliveInterval") ?? false) + keepAliveInterval = instance?.attributes["keepAliveInterval"]; + + if (instance?.attributes.containsKey("keepAliveTime") ?? false) + keepAliveTime = instance?.attributes["keepAliveTime"]; + if (instance?.attributes.containsKey("username") == true && instance?.attributes.containsKey("password") == true) { var username = instance?.attributes["username"] as String; @@ -594,7 +606,7 @@ class DistributedConnection extends NetworkConnection with IStore { Timer? _keepAliveTimer; - int KeepAliveInterval = 30; + int keepAliveInterval = 30; void init() { _queue.then((x) { @@ -636,7 +648,7 @@ class DistributedConnection extends NetworkConnection with IStore { jitter = x?[1]; _keepAliveTimer = - Timer(Duration(seconds: KeepAliveInterval), _keepAliveTimerElapsed); + Timer(Duration(seconds: keepAliveInterval), _keepAliveTimerElapsed); //print("Keep Alive Received ${jitter}"); @@ -1142,7 +1154,7 @@ class DistributedConnection extends NetworkConnection with IStore { // start perodic keep alive timer _keepAliveTimer = Timer( - Duration(seconds: KeepAliveInterval), _keepAliveTimerElapsed); + Duration(seconds: keepAliveInterval), _keepAliveTimerElapsed); } } else if (_authPacket.command == IIPAuthPacketCommand.Error) { _invalidCredentials = true; diff --git a/lib/src/Proxy/TemplateGenerator.dart b/lib/src/Proxy/TemplateGenerator.dart index 3a1dad7..ef66303 100644 --- a/lib/src/Proxy/TemplateGenerator.dart +++ b/lib/src/Proxy/TemplateGenerator.dart @@ -83,7 +83,7 @@ class TemplateGenerator { template.properties.forEach((p) { if (p.inherited) return; var ptTypeName = getTypeName(template, p.valueType, templates); - rt.writeln("${ptTypeName}? ${p.name};"); + rt.writeln("${ptTypeName} ${p.name};"); rt.writeln(); }); @@ -362,7 +362,7 @@ class TemplateGenerator { }).join("\r\n"); var typesFile = makeImports(null) + - "\r\n void init_${dir}(){ ${defineCreators} \r\n ${putTemplates}}"; + "\r\n void init_${dir?.replaceAll('.', '_')}(){ ${defineCreators} \r\n ${putTemplates}}"; var f = File("${dstDir.path}/init.g.dart"); f.writeAsStringSync(typesFile); diff --git a/pubspec.yaml b/pubspec.yaml index c554d1a..a3226a6 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: esiur description: Distributed Object Framework. -version: 2.0.7 +version: 2.0.9 #author: Ahmed Zamil homepage: https://github.com/esiur/esiur-dart