2
0
mirror of https://github.com/esiur/esiur-dart.git synced 2025-05-06 12:02:57 +00:00

reconnectInterval

This commit is contained in:
Esiur Project 2022-08-13 04:01:29 +03:00
parent 083ea92d3b
commit 51ecac1c55
4 changed files with 136 additions and 118 deletions

View File

@ -23,9 +23,10 @@ SOFTWARE.
*/ */
import 'dart:async'; import 'dart:async';
import 'dart:core'; import 'dart:core';
import 'package:esiur/esiur.dart';
import 'AsyncException.dart'; import 'AsyncException.dart';
import 'ErrorType.dart';
import 'ExceptionCode.dart';
import 'ProgressType.dart'; import 'ProgressType.dart';
class AsyncReply<T> implements Future<T> { class AsyncReply<T> implements Future<T> {

View File

@ -152,6 +152,7 @@ class DistributedConnection extends NetworkConnection with IStore {
DateTime? _lastKeepAliveReceived; DateTime? _lastKeepAliveReceived;
int jitter = 0; int jitter = 0;
int keepAliveTime = 10; int keepAliveTime = 10;
int reconnectInterval = 5;
DistributedServer? server; DistributedServer? server;
@ -190,7 +191,7 @@ class DistributedConnection extends NetworkConnection with IStore {
/// Send data to the other end as parameters /// Send data to the other end as parameters
/// </summary> /// </summary>
/// <param name="values">Values will be converted to bytes then sent.</param> /// <param name="values">Values will be converted to bytes then sent.</param>
SendList sendParams([AsyncReply<List<dynamic>?>? reply = null]) { SendList _sendParams([AsyncReply<List<dynamic>?>? reply = null]) {
return new SendList(this, reply); return new SendList(this, reply);
} }
@ -321,7 +322,8 @@ class DistributedConnection extends NetworkConnection with IStore {
..error((x) { ..error((x) {
if (autoReconnect) { if (autoReconnect) {
print("Reconnecting socket..."); print("Reconnecting socket...");
Future.delayed(Duration(seconds: 5), () => _connectSocket(socket)); Future.delayed(Duration(seconds: reconnectInterval),
() => _connectSocket(socket));
} else { } else {
_openReply?.triggerError(x); _openReply?.triggerError(x);
_openReply = null; _openReply = null;
@ -338,7 +340,7 @@ class DistributedConnection extends NetworkConnection with IStore {
_ready = false; _ready = false;
_readyToEstablish = false; _readyToEstablish = false;
print("Disconnected .."); //print("Disconnected ..");
_keepAliveTimer?.cancel(); _keepAliveTimer?.cancel();
_keepAliveTimer = null; _keepAliveTimer = null;
@ -387,7 +389,7 @@ class DistributedConnection extends NetworkConnection with IStore {
// _server.membership?.Logout(session); // _server.membership?.Logout(session);
} else if (autoReconnect && !_invalidCredentials) { } else if (autoReconnect && !_invalidCredentials) {
Future.delayed(Duration(seconds: 5), reconnect); Future.delayed(Duration(seconds: reconnectInterval), reconnect);
} else { } else {
_suspendedResources.clear(); _suspendedResources.clear();
} }
@ -411,7 +413,7 @@ class DistributedConnection extends NetworkConnection with IStore {
for (var r in toBeRestored) { for (var r in toBeRestored) {
var link = DC.stringToBytes(r.distributedResourceLink ?? ""); var link = DC.stringToBytes(r.distributedResourceLink ?? "");
print("Restoring " + (r.distributedResourceLink ?? "")); //print("Restoring " + (r.distributedResourceLink ?? ""));
try { try {
var ar = await (sendRequest(IIPPacketAction.QueryLink) var ar = await (sendRequest(IIPPacketAction.QueryLink)
@ -472,7 +474,7 @@ class DistributedConnection extends NetworkConnection with IStore {
var un = DC.stringToBytes(_session?.localAuthentication.username ?? ""); var un = DC.stringToBytes(_session?.localAuthentication.username ?? "");
sendParams() _sendParams()
..addUint8(0x60) ..addUint8(0x60)
..addUint8(dmn.length) ..addUint8(dmn.length)
..addDC(dmn) ..addDC(dmn)
@ -482,7 +484,7 @@ class DistributedConnection extends NetworkConnection with IStore {
..done(); //, dmn, localNonce, (byte)un.Length, un); ..done(); //, dmn, localNonce, (byte)un.Length, un);
} else if (_session?.localAuthentication.method == } else if (_session?.localAuthentication.method ==
AuthenticationMethod.Token) { AuthenticationMethod.Token) {
sendParams() _sendParams()
..addUint8(0x70) ..addUint8(0x70)
..addUint8(dmn.length) ..addUint8(dmn.length)
..addDC(dmn) ..addDC(dmn)
@ -492,7 +494,7 @@ class DistributedConnection extends NetworkConnection with IStore {
} else if (_session?.localAuthentication.method == } else if (_session?.localAuthentication.method ==
AuthenticationMethod.None) { AuthenticationMethod.None) {
sendParams() _sendParams()
..addUint8(0x40) ..addUint8(0x40)
..addUint8(dmn.length) ..addUint8(dmn.length)
..addDC(dmn) ..addDC(dmn)
@ -606,7 +608,7 @@ class DistributedConnection extends NetworkConnection with IStore {
// Timer(Duration(seconds: KeepAliveInterval), _keepAliveTimer_Elapsed); // Timer(Duration(seconds: KeepAliveInterval), _keepAliveTimer_Elapsed);
} }
void _keepAliveTimer_Elapsed() { void _keepAliveTimerElapsed() {
if (!isConnected) return; if (!isConnected) return;
_keepAliveTimer?.cancel(); _keepAliveTimer?.cancel();
@ -628,10 +630,25 @@ class DistributedConnection extends NetworkConnection with IStore {
..then((x) { ..then((x) {
jitter = x?[1]; jitter = x?[1];
_keepAliveTimer = Timer( _keepAliveTimer =
Duration(seconds: KeepAliveInterval), _keepAliveTimer_Elapsed); Timer(Duration(seconds: KeepAliveInterval), _keepAliveTimerElapsed);
//print("Keep Alive Received ${jitter}"); //print("Keep Alive Received ${jitter}");
// Run GC
var toBeRemoved = [];
_attachedResources.forEach((key, value) {
var r = value.target;
if (r == null) toBeRemoved.add(key);
});
if (toBeRemoved.length > 0)
print("GC " + toBeRemoved.length.toString());
toBeRemoved.forEach((id) {
_sendDetachRequest(id);
_attachedResources.remove(id);
});
}) })
..error((ex) { ..error((ex) {
_keepAliveTimer?.cancel(); _keepAliveTimer?.cancel();
@ -1039,7 +1056,7 @@ class DistributedConnection extends NetworkConnection with IStore {
for (var i = 0; i < 32; i++) sid[i] = r.nextInt(255); for (var i = 0; i < 32; i++) sid[i] = r.nextInt(255);
_session?.id = sid; _session?.id = sid;
sendParams() _sendParams()
..addUint8(0x28) ..addUint8(0x28)
..addDC(sid) ..addDC(sid)
..done(); ..done();
@ -1059,7 +1076,7 @@ class DistributedConnection extends NetworkConnection with IStore {
AuthenticationType.Client) { AuthenticationType.Client) {
if (_authPacket.command == IIPAuthPacketCommand.Acknowledge) { if (_authPacket.command == IIPAuthPacketCommand.Acknowledge) {
if (_authPacket.remoteMethod == AuthenticationMethod.None) { if (_authPacket.remoteMethod == AuthenticationMethod.None) {
sendParams() _sendParams()
..addUint8(0x20) ..addUint8(0x20)
..addUint16(0) ..addUint16(0)
..done(); ..done();
@ -1075,7 +1092,7 @@ class DistributedConnection extends NetworkConnection with IStore {
..addDC(_remoteNonce as DC)) ..addDC(_remoteNonce as DC))
.toDC()); .toDC());
sendParams() _sendParams()
..addUint8(0) ..addUint8(0)
..addDC(localHash) ..addDC(localHash)
..done(); ..done();
@ -1092,12 +1109,12 @@ class DistributedConnection extends NetworkConnection with IStore {
if (remoteHash.sequenceEqual(_authPacket.hash)) { if (remoteHash.sequenceEqual(_authPacket.hash)) {
// send establish request // send establish request
sendParams() _sendParams()
..addUint8(0x20) ..addUint8(0x20)
..addUint16(0) ..addUint16(0)
..done(); ..done();
} else { } else {
sendParams() _sendParams()
..addUint8(0xc0) ..addUint8(0xc0)
..addUint8(ExceptionCode.ChallengeFailed.index) ..addUint8(ExceptionCode.ChallengeFailed.index)
..addUint16(16) ..addUint16(16)
@ -1117,8 +1134,8 @@ class DistributedConnection extends NetworkConnection with IStore {
emitArgs("ready", []); emitArgs("ready", []);
// start perodic keep alive timer // start perodic keep alive timer
_keepAliveTimer = Timer(Duration(seconds: KeepAliveInterval), _keepAliveTimer = Timer(
_keepAliveTimer_Elapsed); Duration(seconds: KeepAliveInterval), _keepAliveTimerElapsed);
} }
} else if (_authPacket.command == IIPAuthPacketCommand.Error) { } else if (_authPacket.command == IIPAuthPacketCommand.Error) {
_invalidCredentials = true; _invalidCredentials = true;
@ -1207,21 +1224,21 @@ class DistributedConnection extends NetworkConnection with IStore {
var c = _callbackCounter++; // avoid thread racing var c = _callbackCounter++; // avoid thread racing
_requests.add(c, reply); _requests.add(c, reply);
return (sendParams(reply) return (_sendParams(reply)
..addUint8(0x40 | action) ..addUint8(0x40 | action)
..addUint32(c)); ..addUint32(c));
} }
//int _maxcallerid = 0; //int _maxcallerid = 0;
SendList sendReply(int action, int callbackId) { SendList _sendReply(int action, int callbackId) {
return (sendParams() return (_sendParams()
..addUint8((0x80 | action)) ..addUint8((0x80 | action))
..addUint32(callbackId)); ..addUint32(callbackId));
} }
SendList sendEvent(int evt) { SendList sendEvent(int evt) {
return (sendParams()..addUint8((evt))); return (_sendParams()..addUint8((evt)));
} }
AsyncReply<dynamic> sendListenRequest(int instanceId, int index) { AsyncReply<dynamic> sendListenRequest(int instanceId, int index) {
@ -1229,7 +1246,7 @@ class DistributedConnection extends NetworkConnection with IStore {
var c = _callbackCounter++; var c = _callbackCounter++;
_requests.add(c, reply); _requests.add(c, reply);
sendParams() _sendParams()
..addUint8(0x40 | IIPPacketAction.Listen) ..addUint8(0x40 | IIPPacketAction.Listen)
..addUint32(c) ..addUint32(c)
..addUint32(instanceId) ..addUint32(instanceId)
@ -1243,7 +1260,7 @@ class DistributedConnection extends NetworkConnection with IStore {
var c = _callbackCounter++; var c = _callbackCounter++;
_requests.add(c, reply); _requests.add(c, reply);
sendParams() _sendParams()
..addUint8(0x40 | IIPPacketAction.Unlisten) ..addUint8(0x40 | IIPPacketAction.Unlisten)
..addUint32(c) ..addUint32(c)
..addUint32(instanceId) ..addUint32(instanceId)
@ -1260,7 +1277,7 @@ class DistributedConnection extends NetworkConnection with IStore {
var c = _callbackCounter++; var c = _callbackCounter++;
_requests.add(c, reply); _requests.add(c, reply);
sendParams() _sendParams()
..addUint8(0x40 | IIPPacketAction.InvokeFunction) ..addUint8(0x40 | IIPPacketAction.InvokeFunction)
..addUint32(c) ..addUint32(c)
..addUint32(instanceId) ..addUint32(instanceId)
@ -1294,17 +1311,17 @@ class DistributedConnection extends NetworkConnection with IStore {
} }
} }
void sendError(ErrorType type, int callbackId, int errorCode, void _sendError(ErrorType type, int callbackId, int errorCode,
[String? errorMessage]) { [String? errorMessage]) {
var msg = DC.stringToBytes(errorMessage ?? ""); var msg = DC.stringToBytes(errorMessage ?? "");
if (type == ErrorType.Management) if (type == ErrorType.Management)
sendParams() _sendParams()
..addUint8(0xC0 | IIPPacketReport.ManagementError) ..addUint8(0xC0 | IIPPacketReport.ManagementError)
..addUint32(callbackId) ..addUint32(callbackId)
..addUint16(errorCode) ..addUint16(errorCode)
..done(); ..done();
else if (type == ErrorType.Exception) else if (type == ErrorType.Exception)
sendParams() _sendParams()
..addUint8(0xC0 | IIPPacketReport.ExecutionError) ..addUint8(0xC0 | IIPPacketReport.ExecutionError)
..addUint32(callbackId) ..addUint32(callbackId)
..addUint16(errorCode) ..addUint16(errorCode)
@ -1314,7 +1331,7 @@ class DistributedConnection extends NetworkConnection with IStore {
} }
void sendProgress(int callbackId, int value, int max) { void sendProgress(int callbackId, int value, int max) {
sendParams() _sendParams()
..addUint8(0xC0 | IIPPacketReport.ProgressReport) ..addUint8(0xC0 | IIPPacketReport.ProgressReport)
..addUint32(callbackId) ..addUint32(callbackId)
..addInt32(value) ..addInt32(value)
@ -1325,7 +1342,7 @@ class DistributedConnection extends NetworkConnection with IStore {
void sendChunk(int callbackId, dynamic chunk) { void sendChunk(int callbackId, dynamic chunk) {
var c = Codec.compose(chunk, this); var c = Codec.compose(chunk, this);
sendParams() _sendParams()
..addUint8(0xC0 | IIPPacketReport.ChunkStream) ..addUint8(0xC0 | IIPPacketReport.ChunkStream)
..addUint32(callbackId) ..addUint32(callbackId)
..addDC(c) ..addDC(c)
@ -1545,7 +1562,7 @@ class DistributedConnection extends NetworkConnection with IStore {
if (r.instance if (r.instance
?.applicable(_session as Session, ActionType.Attach, null) == ?.applicable(_session as Session, ActionType.Attach, null) ==
Ruling.Denied) { Ruling.Denied) {
sendError(ErrorType.Management, callback, 6); _sendError(ErrorType.Management, callback, 6);
return; return;
} }
@ -1555,7 +1572,7 @@ class DistributedConnection extends NetworkConnection with IStore {
if (r is DistributedResource) { if (r is DistributedResource) {
// reply ok // reply ok
sendReply(IIPPacketAction.AttachResource, callback) _sendReply(IIPPacketAction.AttachResource, callback)
..addGuid(r.instance?.template.classId as Guid) ..addGuid(r.instance?.template.classId as Guid)
..addUint64(r.instance?.age as int) ..addUint64(r.instance?.age as int)
..addUint16(link.length) ..addUint16(link.length)
@ -1567,7 +1584,7 @@ class DistributedConnection extends NetworkConnection with IStore {
..done(); ..done();
} else { } else {
// reply ok // reply ok
sendReply(IIPPacketAction.AttachResource, callback) _sendReply(IIPPacketAction.AttachResource, callback)
..addGuid((r.instance as Instance).template.classId) ..addGuid((r.instance as Instance).template.classId)
..addUint64((r.instance as Instance).age) ..addUint64((r.instance as Instance).age)
..addUint16(link.length) ..addUint16(link.length)
@ -1583,7 +1600,7 @@ class DistributedConnection extends NetworkConnection with IStore {
} else { } else {
// reply failed // reply failed
//SendParams(0x80, r.instance.id, r.instance.Age, r.instance.serialize(false, this)); //SendParams(0x80, r.instance.id, r.instance.Age, r.instance.serialize(false, this));
sendError(ErrorType.Management, callback, _sendError(ErrorType.Management, callback,
ExceptionCode.ResourceNotFound.index); ExceptionCode.ResourceNotFound.index);
} }
}); });
@ -1649,13 +1666,13 @@ class DistributedConnection extends NetworkConnection with IStore {
_subscribe(r); _subscribe(r);
// reply ok // reply ok
sendReply(IIPPacketAction.ReattachResource, callback) _sendReply(IIPPacketAction.ReattachResource, callback)
..addUint64((r.instance as Instance).age) ..addUint64((r.instance as Instance).age)
..addDC(Codec.compose((r.instance as Instance).serialize(), this)) ..addDC(Codec.compose((r.instance as Instance).serialize(), this))
..done(); ..done();
} else { } else {
// reply failed // reply failed
sendError(ErrorType.Management, callback, _sendError(ErrorType.Management, callback,
ExceptionCode.ResourceNotFound.index); ExceptionCode.ResourceNotFound.index);
} }
}); });
@ -1666,10 +1683,10 @@ class DistributedConnection extends NetworkConnection with IStore {
if (res != null) { if (res != null) {
_unsubscribe(res); _unsubscribe(res);
// reply ok // reply ok
sendReply(IIPPacketAction.DetachResource, callback).done(); _sendReply(IIPPacketAction.DetachResource, callback).done();
} else { } else {
// reply failed // reply failed
sendError(ErrorType.Management, callback, _sendError(ErrorType.Management, callback,
ExceptionCode.ResourceNotFound.index); ExceptionCode.ResourceNotFound.index);
} }
}); });
@ -1680,13 +1697,13 @@ class DistributedConnection extends NetworkConnection with IStore {
int callback, int storeId, int parentId, DC content) { int callback, int storeId, int parentId, DC content) {
Warehouse.getById(storeId).then((store) { Warehouse.getById(storeId).then((store) {
if (store == null) { if (store == null) {
sendError( _sendError(
ErrorType.Management, callback, ExceptionCode.StoreNotFound.index); ErrorType.Management, callback, ExceptionCode.StoreNotFound.index);
return; return;
} }
if (!(store is IStore)) { if (!(store is IStore)) {
sendError(ErrorType.Management, callback, _sendError(ErrorType.Management, callback,
ExceptionCode.ResourceIsNotStore.index); ExceptionCode.ResourceIsNotStore.index);
return; return;
} }
@ -1695,7 +1712,7 @@ class DistributedConnection extends NetworkConnection with IStore {
if (store.instance?.applicable( if (store.instance?.applicable(
_session as Session, ActionType.CreateResource, null) != _session as Session, ActionType.CreateResource, null) !=
Ruling.Allowed) { Ruling.Allowed) {
sendError( _sendError(
ErrorType.Management, callback, ExceptionCode.CreateDenied.index); ErrorType.Management, callback, ExceptionCode.CreateDenied.index);
return; return;
} }
@ -1706,7 +1723,7 @@ class DistributedConnection extends NetworkConnection with IStore {
if (parent != null) if (parent.instance if (parent != null) if (parent.instance
?.applicable(_session as Session, ActionType.AddChild, null) != ?.applicable(_session as Session, ActionType.AddChild, null) !=
Ruling.Allowed) { Ruling.Allowed) {
sendError(ErrorType.Management, callback, _sendError(ErrorType.Management, callback,
ExceptionCode.AddChildDenied.index); ExceptionCode.AddChildDenied.index);
return; return;
} }
@ -1726,7 +1743,7 @@ class DistributedConnection extends NetworkConnection with IStore {
var type = null; //Type.getType(className); var type = null; //Type.getType(className);
if (type == null) { if (type == null) {
sendError(ErrorType.Management, callback, _sendError(ErrorType.Management, callback,
ExceptionCode.ClassNotFound.index); ExceptionCode.ClassNotFound.index);
return; return;
} }
@ -1776,13 +1793,13 @@ class DistributedConnection extends NetworkConnection with IStore {
Warehouse.put<IResource>( Warehouse.put<IResource>(
name, resource as IResource, store, parent) name, resource as IResource, store, parent)
..then((ok) { ..then((ok) {
sendReply(IIPPacketAction.CreateResource, callback) _sendReply(IIPPacketAction.CreateResource, callback)
..addUint32((resource.instance as Instance).id) ..addUint32((resource.instance as Instance).id)
..done(); ..done();
}) })
..error((ex) { ..error((ex) {
// send some error // send some error
sendError(ErrorType.Management, callback, _sendError(ErrorType.Management, callback,
ExceptionCode.AddToStoreFailed.index); ExceptionCode.AddToStoreFailed.index);
}); });
}); });
@ -1795,7 +1812,7 @@ class DistributedConnection extends NetworkConnection with IStore {
void iipRequestDeleteResource(int callback, int resourceId) { void iipRequestDeleteResource(int callback, int resourceId) {
Warehouse.getById(resourceId).then((r) { Warehouse.getById(resourceId).then((r) {
if (r == null) { if (r == null) {
sendError(ErrorType.Management, callback, _sendError(ErrorType.Management, callback,
ExceptionCode.ResourceNotFound.index); ExceptionCode.ResourceNotFound.index);
return; return;
} }
@ -1803,16 +1820,16 @@ class DistributedConnection extends NetworkConnection with IStore {
if (r.instance?.store?.instance if (r.instance?.store?.instance
?.applicable(_session as Session, ActionType.Delete, null) != ?.applicable(_session as Session, ActionType.Delete, null) !=
Ruling.Allowed) { Ruling.Allowed) {
sendError( _sendError(
ErrorType.Management, callback, ExceptionCode.DeleteDenied.index); ErrorType.Management, callback, ExceptionCode.DeleteDenied.index);
return; return;
} }
if (Warehouse.remove(r)) if (Warehouse.remove(r))
sendReply(IIPPacketAction.DeleteResource, callback).done(); _sendReply(IIPPacketAction.DeleteResource, callback).done();
//SendParams((byte)0x84, callback); //SendParams((byte)0x84, callback);
else else
sendError( _sendError(
ErrorType.Management, callback, ExceptionCode.DeleteFailed.index); ErrorType.Management, callback, ExceptionCode.DeleteFailed.index);
}); });
} }
@ -1821,7 +1838,7 @@ class DistributedConnection extends NetworkConnection with IStore {
[bool all = false]) { [bool all = false]) {
Warehouse.getById(resourceId).then((r) { Warehouse.getById(resourceId).then((r) {
if (r == null) { if (r == null) {
sendError(ErrorType.Management, callback, _sendError(ErrorType.Management, callback,
ExceptionCode.ResourceNotFound.index); ExceptionCode.ResourceNotFound.index);
return; return;
} }
@ -1830,7 +1847,7 @@ class DistributedConnection extends NetworkConnection with IStore {
if (r.instance?.applicable( if (r.instance?.applicable(
_session as Session, ActionType.InquireAttributes, null) != _session as Session, ActionType.InquireAttributes, null) !=
Ruling.Allowed) { Ruling.Allowed) {
sendError(ErrorType.Management, callback, _sendError(ErrorType.Management, callback,
ExceptionCode.ViewAttributeDenied.index); ExceptionCode.ViewAttributeDenied.index);
return; return;
} }
@ -1842,7 +1859,7 @@ class DistributedConnection extends NetworkConnection with IStore {
var st = r.instance?.getAttributes(attrs); var st = r.instance?.getAttributes(attrs);
if (st != null) if (st != null)
sendReply( _sendReply(
all all
? IIPPacketAction.GetAllAttributes ? IIPPacketAction.GetAllAttributes
: IIPPacketAction.GetAttributes, : IIPPacketAction.GetAttributes,
@ -1850,7 +1867,7 @@ class DistributedConnection extends NetworkConnection with IStore {
..addDC(Codec.compose(st, this)) ..addDC(Codec.compose(st, this))
..done(); ..done();
else else
sendError(ErrorType.Management, callback, _sendError(ErrorType.Management, callback,
ExceptionCode.GetAttributesFailed.index); ExceptionCode.GetAttributesFailed.index);
}); });
} }
@ -1858,14 +1875,14 @@ class DistributedConnection extends NetworkConnection with IStore {
void iipRequestAddChild(int callback, int parentId, int childId) { void iipRequestAddChild(int callback, int parentId, int childId) {
Warehouse.getById(parentId).then((parent) { Warehouse.getById(parentId).then((parent) {
if (parent == null) { if (parent == null) {
sendError(ErrorType.Management, callback, _sendError(ErrorType.Management, callback,
ExceptionCode.ResourceNotFound.index); ExceptionCode.ResourceNotFound.index);
return; return;
} }
Warehouse.getById(childId).then((child) { Warehouse.getById(childId).then((child) {
if (child == null) { if (child == null) {
sendError(ErrorType.Management, callback, _sendError(ErrorType.Management, callback,
ExceptionCode.ResourceNotFound.index); ExceptionCode.ResourceNotFound.index);
return; return;
} }
@ -1873,7 +1890,7 @@ class DistributedConnection extends NetworkConnection with IStore {
if (parent.instance if (parent.instance
?.applicable(_session as Session, ActionType.AddChild, null) != ?.applicable(_session as Session, ActionType.AddChild, null) !=
Ruling.Allowed) { Ruling.Allowed) {
sendError(ErrorType.Management, callback, _sendError(ErrorType.Management, callback,
ExceptionCode.AddChildDenied.index); ExceptionCode.AddChildDenied.index);
return; return;
} }
@ -1881,14 +1898,14 @@ class DistributedConnection extends NetworkConnection with IStore {
if (child.instance if (child.instance
?.applicable(_session as Session, ActionType.AddParent, null) != ?.applicable(_session as Session, ActionType.AddParent, null) !=
Ruling.Allowed) { Ruling.Allowed) {
sendError(ErrorType.Management, callback, _sendError(ErrorType.Management, callback,
ExceptionCode.AddParentDenied.index); ExceptionCode.AddParentDenied.index);
return; return;
} }
parent.instance?.children.add(child); parent.instance?.children.add(child);
sendReply(IIPPacketAction.AddChild, callback).done(); _sendReply(IIPPacketAction.AddChild, callback).done();
//child.instance.Parents //child.instance.Parents
}); });
}); });
@ -1897,14 +1914,14 @@ class DistributedConnection extends NetworkConnection with IStore {
void iipRequestRemoveChild(int callback, int parentId, int childId) { void iipRequestRemoveChild(int callback, int parentId, int childId) {
Warehouse.getById(parentId).then((parent) { Warehouse.getById(parentId).then((parent) {
if (parent == null) { if (parent == null) {
sendError(ErrorType.Management, callback, _sendError(ErrorType.Management, callback,
ExceptionCode.ResourceNotFound.index); ExceptionCode.ResourceNotFound.index);
return; return;
} }
Warehouse.getById(childId).then((child) { Warehouse.getById(childId).then((child) {
if (child == null) { if (child == null) {
sendError(ErrorType.Management, callback, _sendError(ErrorType.Management, callback,
ExceptionCode.ResourceNotFound.index); ExceptionCode.ResourceNotFound.index);
return; return;
} }
@ -1912,7 +1929,7 @@ class DistributedConnection extends NetworkConnection with IStore {
if (parent.instance?.applicable( if (parent.instance?.applicable(
_session as Session, ActionType.RemoveChild, null) != _session as Session, ActionType.RemoveChild, null) !=
Ruling.Allowed) { Ruling.Allowed) {
sendError(ErrorType.Management, callback, _sendError(ErrorType.Management, callback,
ExceptionCode.AddChildDenied.index); ExceptionCode.AddChildDenied.index);
return; return;
} }
@ -1920,14 +1937,14 @@ class DistributedConnection extends NetworkConnection with IStore {
if (child.instance?.applicable( if (child.instance?.applicable(
_session as Session, ActionType.RemoveParent, null) != _session as Session, ActionType.RemoveParent, null) !=
Ruling.Allowed) { Ruling.Allowed) {
sendError(ErrorType.Management, callback, _sendError(ErrorType.Management, callback,
ExceptionCode.AddParentDenied.index); ExceptionCode.AddParentDenied.index);
return; return;
} }
parent.instance?.children.remove(child); parent.instance?.children.remove(child);
sendReply(IIPPacketAction.RemoveChild, callback).done(); _sendReply(IIPPacketAction.RemoveChild, callback).done();
//child.instance.Parents //child.instance.Parents
}); });
}); });
@ -1936,7 +1953,7 @@ class DistributedConnection extends NetworkConnection with IStore {
void iipRequestRenameResource(int callback, int resourceId, String name) { void iipRequestRenameResource(int callback, int resourceId, String name) {
Warehouse.getById(resourceId).then((resource) { Warehouse.getById(resourceId).then((resource) {
if (resource == null) { if (resource == null) {
sendError(ErrorType.Management, callback, _sendError(ErrorType.Management, callback,
ExceptionCode.ResourceNotFound.index); ExceptionCode.ResourceNotFound.index);
return; return;
} }
@ -1944,25 +1961,25 @@ class DistributedConnection extends NetworkConnection with IStore {
if (resource.instance if (resource.instance
?.applicable(_session as Session, ActionType.Rename, null) != ?.applicable(_session as Session, ActionType.Rename, null) !=
Ruling.Allowed) { Ruling.Allowed) {
sendError( _sendError(
ErrorType.Management, callback, ExceptionCode.RenameDenied.index); ErrorType.Management, callback, ExceptionCode.RenameDenied.index);
return; return;
} }
resource.instance?.name = name; resource.instance?.name = name;
sendReply(IIPPacketAction.RenameResource, callback).done(); _sendReply(IIPPacketAction.RenameResource, callback).done();
}); });
} }
void iipRequestResourceChildren(int callback, int resourceId) { void iipRequestResourceChildren(int callback, int resourceId) {
Warehouse.getById(resourceId).then((resource) { Warehouse.getById(resourceId).then((resource) {
if (resource == null) { if (resource == null) {
sendError(ErrorType.Management, callback, _sendError(ErrorType.Management, callback,
ExceptionCode.ResourceNotFound.index); ExceptionCode.ResourceNotFound.index);
return; return;
} }
sendReply(IIPPacketAction.ResourceChildren, callback) _sendReply(IIPPacketAction.ResourceChildren, callback)
..addDC(Codec.compose( ..addDC(Codec.compose(
resource.instance?.children.toList() as List<IResource>, this)) resource.instance?.children.toList() as List<IResource>, this))
..done(); ..done();
@ -1972,12 +1989,12 @@ class DistributedConnection extends NetworkConnection with IStore {
void iipRequestResourceParents(int callback, int resourceId) { void iipRequestResourceParents(int callback, int resourceId) {
Warehouse.getById(resourceId).then((resource) { Warehouse.getById(resourceId).then((resource) {
if (resource == null) { if (resource == null) {
sendError(ErrorType.Management, callback, _sendError(ErrorType.Management, callback,
ExceptionCode.ResourceNotFound.index); ExceptionCode.ResourceNotFound.index);
return; return;
} }
sendReply(IIPPacketAction.ResourceParents, callback) _sendReply(IIPPacketAction.ResourceParents, callback)
..addDC(Codec.compose( ..addDC(Codec.compose(
resource.instance?.parents.toList() as List<IResource>, this)) resource.instance?.parents.toList() as List<IResource>, this))
..done(); ..done();
@ -1988,7 +2005,7 @@ class DistributedConnection extends NetworkConnection with IStore {
[bool all = false]) { [bool all = false]) {
Warehouse.getById(resourceId).then((r) { Warehouse.getById(resourceId).then((r) {
if (r == null) { if (r == null) {
sendError(ErrorType.Management, callback, _sendError(ErrorType.Management, callback,
ExceptionCode.ResourceNotFound.index); ExceptionCode.ResourceNotFound.index);
return; return;
} }
@ -1996,7 +2013,7 @@ class DistributedConnection extends NetworkConnection with IStore {
if (r.instance?.store?.instance?.applicable( if (r.instance?.store?.instance?.applicable(
_session as Session, ActionType.UpdateAttributes, null) != _session as Session, ActionType.UpdateAttributes, null) !=
Ruling.Allowed) { Ruling.Allowed) {
sendError(ErrorType.Management, callback, _sendError(ErrorType.Management, callback,
ExceptionCode.UpdateAttributeDenied.index); ExceptionCode.UpdateAttributeDenied.index);
return; return;
} }
@ -2006,14 +2023,14 @@ class DistributedConnection extends NetworkConnection with IStore {
if (!all) attrs = attributes.getStringArray(0, attributes.length); if (!all) attrs = attributes.getStringArray(0, attributes.length);
if (r.instance?.removeAttributes(attrs) == true) if (r.instance?.removeAttributes(attrs) == true)
sendReply( _sendReply(
all all
? IIPPacketAction.ClearAllAttributes ? IIPPacketAction.ClearAllAttributes
: IIPPacketAction.ClearAttributes, : IIPPacketAction.ClearAttributes,
callback) callback)
.done(); .done();
else else
sendError(ErrorType.Management, callback, _sendError(ErrorType.Management, callback,
ExceptionCode.UpdateAttributeFailed.index); ExceptionCode.UpdateAttributeFailed.index);
}); });
} }
@ -2022,7 +2039,7 @@ class DistributedConnection extends NetworkConnection with IStore {
[bool clearAttributes = false]) { [bool clearAttributes = false]) {
Warehouse.getById(resourceId).then((r) { Warehouse.getById(resourceId).then((r) {
if (r == null) { if (r == null) {
sendError(ErrorType.Management, callback, _sendError(ErrorType.Management, callback,
ExceptionCode.ResourceNotFound.index); ExceptionCode.ResourceNotFound.index);
return; return;
} }
@ -2030,7 +2047,7 @@ class DistributedConnection extends NetworkConnection with IStore {
if (r.instance?.store?.instance?.applicable( if (r.instance?.store?.instance?.applicable(
_session as Session, ActionType.UpdateAttributes, null) != _session as Session, ActionType.UpdateAttributes, null) !=
Ruling.Allowed) { Ruling.Allowed) {
sendError(ErrorType.Management, callback, _sendError(ErrorType.Management, callback,
ExceptionCode.UpdateAttributeDenied.index); ExceptionCode.UpdateAttributeDenied.index);
return; return;
} }
@ -2041,14 +2058,14 @@ class DistributedConnection extends NetworkConnection with IStore {
if (r.instance?.setAttributes( if (r.instance?.setAttributes(
attrs as Map<String, dynamic>, clearAttributes) == attrs as Map<String, dynamic>, clearAttributes) ==
true) true)
sendReply( _sendReply(
clearAttributes clearAttributes
? IIPPacketAction.ClearAllAttributes ? IIPPacketAction.ClearAllAttributes
: IIPPacketAction.ClearAttributes, : IIPPacketAction.ClearAttributes,
callback) callback)
.done(); .done();
else else
sendError(ErrorType.Management, callback, _sendError(ErrorType.Management, callback,
ExceptionCode.UpdateAttributeFailed.index); ExceptionCode.UpdateAttributeFailed.index);
}); });
}); });
@ -2057,7 +2074,7 @@ class DistributedConnection extends NetworkConnection with IStore {
void iipRequestLinkTemplates(int callback, String resourceLink) { void iipRequestLinkTemplates(int callback, String resourceLink) {
var queryCallback = (List<IResource>? r) { var queryCallback = (List<IResource>? r) {
if (r == null) if (r == null)
sendError(ErrorType.Management, callback, _sendError(ErrorType.Management, callback,
ExceptionCode.ResourceNotFound.index); ExceptionCode.ResourceNotFound.index);
else { else {
var list = r.where((x) => var list = r.where((x) =>
@ -2066,7 +2083,7 @@ class DistributedConnection extends NetworkConnection with IStore {
Ruling.Denied); Ruling.Denied);
if (list.length == 0) if (list.length == 0)
sendError(ErrorType.Management, callback, _sendError(ErrorType.Management, callback,
ExceptionCode.ResourceNotFound.index); ExceptionCode.ResourceNotFound.index);
else { else {
// get all templates related to this resource // get all templates related to this resource
@ -2087,7 +2104,7 @@ class DistributedConnection extends NetworkConnection with IStore {
}); });
// digggg // digggg
sendReply(IIPPacketAction.LinkTemplates, callback) _sendReply(IIPPacketAction.LinkTemplates, callback)
..addDC(TransmissionType.compose( ..addDC(TransmissionType.compose(
TransmissionTypeIdentifier.RawData, msg.toDC())) TransmissionTypeIdentifier.RawData, msg.toDC()))
..done(); ..done();
@ -2104,13 +2121,13 @@ class DistributedConnection extends NetworkConnection with IStore {
void iipRequestTemplateFromClassName(int callback, String className) { void iipRequestTemplateFromClassName(int callback, String className) {
var t = Warehouse.getTemplateByClassName(className); var t = Warehouse.getTemplateByClassName(className);
if (t != null) { if (t != null) {
sendReply(IIPPacketAction.TemplateFromClassName, callback) _sendReply(IIPPacketAction.TemplateFromClassName, callback)
..addDC(TransmissionType.compose( ..addDC(TransmissionType.compose(
TransmissionTypeIdentifier.RawData, t.content)) TransmissionTypeIdentifier.RawData, t.content))
..done(); ..done();
} else { } else {
// reply failed // reply failed
sendError( _sendError(
ErrorType.Management, callback, ExceptionCode.TemplateNotFound.index); ErrorType.Management, callback, ExceptionCode.TemplateNotFound.index);
} }
} }
@ -2118,13 +2135,13 @@ class DistributedConnection extends NetworkConnection with IStore {
void iipRequestTemplateFromClassId(int callback, Guid classId) { void iipRequestTemplateFromClassId(int callback, Guid classId) {
var t = Warehouse.getTemplateByClassId(classId); var t = Warehouse.getTemplateByClassId(classId);
if (t != null) if (t != null)
sendReply(IIPPacketAction.TemplateFromClassId, callback) _sendReply(IIPPacketAction.TemplateFromClassId, callback)
..addDC(TransmissionType.compose( ..addDC(TransmissionType.compose(
TransmissionTypeIdentifier.RawData, t.content)) TransmissionTypeIdentifier.RawData, t.content))
..done(); ..done();
else { else {
// reply failed // reply failed
sendError( _sendError(
ErrorType.Management, callback, ExceptionCode.TemplateNotFound.index); ErrorType.Management, callback, ExceptionCode.TemplateNotFound.index);
} }
} }
@ -2132,13 +2149,13 @@ class DistributedConnection extends NetworkConnection with IStore {
void iipRequestTemplateFromResourceId(int callback, int resourceId) { void iipRequestTemplateFromResourceId(int callback, int resourceId) {
Warehouse.getById(resourceId).then((r) { Warehouse.getById(resourceId).then((r) {
if (r != null) if (r != null)
sendReply(IIPPacketAction.TemplateFromResourceId, callback) _sendReply(IIPPacketAction.TemplateFromResourceId, callback)
..addDC(TransmissionType.compose(TransmissionTypeIdentifier.RawData, ..addDC(TransmissionType.compose(TransmissionTypeIdentifier.RawData,
r.instance?.template.content ?? new DC(0))) r.instance?.template.content ?? new DC(0)))
..done(); ..done();
else { else {
// reply failed // reply failed
sendError(ErrorType.Management, callback, _sendError(ErrorType.Management, callback,
ExceptionCode.TemplateNotFound.index); ExceptionCode.TemplateNotFound.index);
} }
}); });
@ -2147,7 +2164,7 @@ class DistributedConnection extends NetworkConnection with IStore {
void iipRequestQueryResources(int callback, String resourceLink) { void iipRequestQueryResources(int callback, String resourceLink) {
Warehouse.query(resourceLink).then((r) { Warehouse.query(resourceLink).then((r) {
if (r == null) { if (r == null) {
sendError(ErrorType.Management, callback, _sendError(ErrorType.Management, callback,
ExceptionCode.ResourceNotFound.index); ExceptionCode.ResourceNotFound.index);
} else { } else {
var list = r var list = r
@ -2158,10 +2175,10 @@ class DistributedConnection extends NetworkConnection with IStore {
.toList(); .toList();
if (list.length == 0) if (list.length == 0)
sendError(ErrorType.Management, callback, _sendError(ErrorType.Management, callback,
ExceptionCode.ResourceNotFound.index); ExceptionCode.ResourceNotFound.index);
else else
sendReply(IIPPacketAction.QueryLink, callback) _sendReply(IIPPacketAction.QueryLink, callback)
..addDC(Codec.compose(list, this)) ..addDC(Codec.compose(list, this))
..done(); ..done();
} }
@ -2171,7 +2188,7 @@ class DistributedConnection extends NetworkConnection with IStore {
void iipRequestProcedureCall(int callback, String procedureCall, void iipRequestProcedureCall(int callback, String procedureCall,
TransmissionType transmissionType, DC content) { TransmissionType transmissionType, DC content) {
// server not implemented // server not implemented
sendError( _sendError(
ErrorType.Management, callback, ExceptionCode.GeneralFailure.index); ErrorType.Management, callback, ExceptionCode.GeneralFailure.index);
// if (server == null) // if (server == null)
@ -2218,7 +2235,7 @@ class DistributedConnection extends NetworkConnection with IStore {
var template = Warehouse.getTemplateByClassId(classId); var template = Warehouse.getTemplateByClassId(classId);
if (template == null) { if (template == null) {
sendError( _sendError(
ErrorType.Management, callback, ExceptionCode.TemplateNotFound.index); ErrorType.Management, callback, ExceptionCode.TemplateNotFound.index);
return; return;
} }
@ -2227,7 +2244,7 @@ class DistributedConnection extends NetworkConnection with IStore {
if (ft == null) { if (ft == null) {
// no function at this index // no function at this index
sendError( _sendError(
ErrorType.Management, callback, ExceptionCode.MethodNotFound.index); ErrorType.Management, callback, ExceptionCode.MethodNotFound.index);
return; return;
} }
@ -2281,7 +2298,7 @@ class DistributedConnection extends NetworkConnection with IStore {
r.internal_invoke(index, arguments as Map<UInt8, dynamic>); r.internal_invoke(index, arguments as Map<UInt8, dynamic>);
if (rt != null) { if (rt != null) {
rt.then((res) { rt.then((res) {
sendReply(IIPPacketAction.InvokeFunction, callback) _sendReply(IIPPacketAction.InvokeFunction, callback)
..addDC(Codec.compose(res, this)) ..addDC(Codec.compose(res, this))
..done(); ..done();
}); });
@ -2314,8 +2331,8 @@ class DistributedConnection extends NetworkConnection with IStore {
if (et != null) { if (et != null) {
if (r is DistributedResource) { if (r is DistributedResource) {
r.listen(et.name).then((x) { r.listen(et.name).then((x) {
sendReply(IIPPacketAction.Listen, callback).done(); _sendReply(IIPPacketAction.Listen, callback).done();
}).error((x) => sendError(ErrorType.Exception, callback, }).error((x) => _sendError(ErrorType.Exception, callback,
ExceptionCode.GeneralFailure.index)); ExceptionCode.GeneralFailure.index));
} else { } else {
// if (!subscriptions.ContainsKey(r)) // if (!subscriptions.ContainsKey(r))
@ -2336,12 +2353,12 @@ class DistributedConnection extends NetworkConnection with IStore {
} }
} else { } else {
// pt not found // pt not found
sendError(ErrorType.Management, callback, _sendError(ErrorType.Management, callback,
ExceptionCode.MethodNotFound.index); ExceptionCode.MethodNotFound.index);
} }
} else { } else {
// resource not found // resource not found
sendError(ErrorType.Management, callback, _sendError(ErrorType.Management, callback,
ExceptionCode.ResourceNotFound.index); ExceptionCode.ResourceNotFound.index);
} }
}); });
@ -2355,8 +2372,8 @@ class DistributedConnection extends NetworkConnection with IStore {
if (et != null) { if (et != null) {
if (r is DistributedResource) { if (r is DistributedResource) {
r.unlisten(et.name).then((x) { r.unlisten(et.name).then((x) {
sendReply(IIPPacketAction.Unlisten, callback).done(); _sendReply(IIPPacketAction.Unlisten, callback).done();
}).error((x) => sendError(ErrorType.Exception, callback, }).error((x) => _sendError(ErrorType.Exception, callback,
ExceptionCode.GeneralFailure.index)); ExceptionCode.GeneralFailure.index));
} else { } else {
// if (!subscriptions.ContainsKey(r)) // if (!subscriptions.ContainsKey(r))
@ -2377,12 +2394,12 @@ class DistributedConnection extends NetworkConnection with IStore {
} }
} else { } else {
// pt not found // pt not found
sendError(ErrorType.Management, callback, _sendError(ErrorType.Management, callback,
ExceptionCode.MethodNotFound.index); ExceptionCode.MethodNotFound.index);
} }
} else { } else {
// resource not found // resource not found
sendError(ErrorType.Management, callback, _sendError(ErrorType.Management, callback,
ExceptionCode.ResourceNotFound.index); ExceptionCode.ResourceNotFound.index);
} }
}); });
@ -2427,7 +2444,7 @@ class DistributedConnection extends NetworkConnection with IStore {
if (results != null) { if (results != null) {
var history = DataSerializer.historyComposer(results, this, true); var history = DataSerializer.historyComposer(results, this, true);
sendReply(IIPPacketAction.ResourceHistory, callback) _sendReply(IIPPacketAction.ResourceHistory, callback)
..addDC(history) ..addDC(history)
..done(); ..done();
} }
@ -2494,10 +2511,10 @@ class DistributedConnection extends NetworkConnection with IStore {
// propagation // propagation
(r as DistributedResource).set(index, value) (r as DistributedResource).set(index, value)
..then((x) { ..then((x) {
sendReply(IIPPacketAction.SetProperty, callback).done(); _sendReply(IIPPacketAction.SetProperty, callback).done();
}) })
..error((x) { ..error((x) {
sendError(x.type, callback, x.code, x.message); _sendError(x.type, callback, x.code, x.message);
}); });
} else { } else {
var pi = null; var pi = null;
@ -2506,13 +2523,13 @@ class DistributedConnection extends NetworkConnection with IStore {
if (r.instance?.applicable(_session as Session, if (r.instance?.applicable(_session as Session,
ActionType.SetProperty, pt, this) == ActionType.SetProperty, pt, this) ==
Ruling.Denied) { Ruling.Denied) {
sendError(ErrorType.Exception, callback, _sendError(ErrorType.Exception, callback,
ExceptionCode.SetPropertyDenied.index); ExceptionCode.SetPropertyDenied.index);
return; return;
} }
if (pi == null) { if (pi == null) {
sendError(ErrorType.Management, callback, _sendError(ErrorType.Management, callback,
ExceptionCode.ReadOnlyProperty.index); ExceptionCode.ReadOnlyProperty.index);
return; return;
} }
@ -2526,25 +2543,25 @@ class DistributedConnection extends NetworkConnection with IStore {
try { try {
pi.setValue(r, value); pi.setValue(r, value);
sendReply(IIPPacketAction.SetProperty, callback).done(); _sendReply(IIPPacketAction.SetProperty, callback).done();
} catch (ex) { } catch (ex) {
sendError(ErrorType.Exception, callback, 0, ex.toString()); _sendError(ErrorType.Exception, callback, 0, ex.toString());
} }
} else { } else {
// pt found, pi not found, this should never happen // pt found, pi not found, this should never happen
sendError(ErrorType.Management, callback, _sendError(ErrorType.Management, callback,
ExceptionCode.PropertyNotFound.index); ExceptionCode.PropertyNotFound.index);
} }
} }
}); });
} else { } else {
// property not found // property not found
sendError(ErrorType.Management, callback, _sendError(ErrorType.Management, callback,
ExceptionCode.PropertyNotFound.index); ExceptionCode.PropertyNotFound.index);
} }
} else { } else {
// resource not found // resource not found
sendError(ErrorType.Management, callback, _sendError(ErrorType.Management, callback,
ExceptionCode.ResourceNotFound.index); ExceptionCode.ResourceNotFound.index);
} }
}); });
@ -3154,7 +3171,7 @@ class DistributedConnection extends NetworkConnection with IStore {
var c = _callbackCounter++; var c = _callbackCounter++;
_requests.add(c, reply); _requests.add(c, reply);
sendParams() _sendParams()
..addUint8((0x40 | IIPPacketAction.StaticCall)) ..addUint8((0x40 | IIPPacketAction.StaticCall))
..addUint32(c) ..addUint32(c)
..addGuid(classId) ..addGuid(classId)
@ -3187,7 +3204,7 @@ class DistributedConnection extends NetworkConnection with IStore {
var callName = DC.stringToBytes(procedureCall); var callName = DC.stringToBytes(procedureCall);
sendParams() _sendParams()
..addUint8(0x40 | IIPPacketAction.ProcedureCall) ..addUint8(0x40 | IIPPacketAction.ProcedureCall)
..addUint32(c) ..addUint32(c)
..addUint16(callName.length) ..addUint16(callName.length)
@ -3210,7 +3227,7 @@ class DistributedConnection extends NetworkConnection with IStore {
jitter = (diff - interval).abs(); jitter = (diff - interval).abs();
} }
sendParams() _sendParams()
..addUint8(0x80 | IIPPacketAction.KeepAlive) ..addUint8(0x80 | IIPPacketAction.KeepAlive)
..addUint32(callbackId) ..addUint32(callbackId)
..addDateTime(now) ..addDateTime(now)

View File

@ -507,7 +507,7 @@ class TemplateGenerator {
rt.writeln("var rt = AsyncReply<$rtTypeName>();"); rt.writeln("var rt = AsyncReply<$rtTypeName>();");
if (f.isStatic) { if (f.isStatic) {
rt.writeln( rt.writeln(
'connection.staticCall(Guid.parse("${template.classId.toString()}"), ${f.index}, args)'); "connection.staticCall(Guid.parse('${template.classId.toString()}'), ${f.index}, args)");
} else { } else {
rt.writeln("internal_invoke(${f.index}, args)"); rt.writeln("internal_invoke(${f.index}, args)");
} }

View File

@ -1,6 +1,6 @@
name: esiur name: esiur
description: Distributed Object Framework. description: Distributed Object Framework.
version: 2.0.4 version: 2.0.5
#author: Ahmed Zamil <ahmed@esiur.com> #author: Ahmed Zamil <ahmed@esiur.com>
homepage: https://github.com/esiur/esiur-dart homepage: https://github.com/esiur/esiur-dart