public static INetworkCache GetCacheForManager(IServiceAddress[] managers) { lock (ServiceCacheMap) { INetworkCache picked = null; int pickedCount = 0; for (int i = 0; i < managers.Length; ++i) { INetworkCache g; if (ServiceCacheMap.TryGetValue(managers[i], out g)) { picked = g; ++pickedCount; } } if (picked == null) { picked = CreateDefaultCacheFor(managers); for (int i = 0; i < managers.Length; ++i) { ServiceCacheMap[managers[i]] = picked; } } else if (pickedCount != managers.Length) { for (int i = 0; i < managers.Length; ++i) { ServiceCacheMap[managers[i]] = picked; } } return(picked); } }
public NetworkClient(IServiceAddress[] managerAddresses, IServiceConnector connector, INetworkCache lnc) { this.connector = connector; this.managerAddresses = managerAddresses; this.localNetworkCache = lnc; // Default values, MaxTransactionNodeCacheHeapSize = 14*1024*1024; }
public NetworkClient(IServiceAddress[] managerAddresses, IServiceConnector connector, INetworkCache lnc) { this.connector = connector; this.managerAddresses = managerAddresses; this.localNetworkCache = lnc; // Default values, MaxTransactionNodeCacheHeapSize = 14 * 1024 * 1024; }
public static void SetCache(IServiceAddress manager, INetworkCache cache) { if (manager == null) throw new ArgumentNullException("manager"); lock (serviceCacheMap) { serviceCacheMap[manager] = cache; } }
public NetworkClient(IServiceAddress managerAddress, IServiceConnector connector, INetworkCache cache) { if (!(connector.MessageSerializer is IRpcMessageSerializer) || !((IRpcMessageSerializer)connector.MessageSerializer).SupportsMessageStream) throw new ArgumentException("The connector given has an invalid message serializer for this context (must be a IRPC serializer)."); this.connector = connector; this.managerAddress = managerAddress; this.cache = cache; }
public NetworkTreeSystem(IServiceConnector connector, IServiceAddress[] managerAddresses, INetworkCache networkCache, ServiceStatusTracker serviceTracker) { this.connector = connector; this.managerAddresses = managerAddresses; this.networkCache = networkCache; this.serviceTracker = serviceTracker; failureFloodControl = new Dictionary<IServiceAddress, DateTime>(); failureFloodControlBidc = new Dictionary<IServiceAddress, DateTime>(); }
internal NetworkTreeSystem(IServiceConnector connector, IServiceAddress managerAddress, INetworkCache networkCache) { if (!(connector.MessageSerializer is IRpcMessageSerializer) || !((IRpcMessageSerializer)connector.MessageSerializer).SupportsMessageStream) throw new ArgumentException("The message serializer specified by the connector is not valid (must be IRPC)."); this.connector = connector; this.managerAddress = managerAddress; this.networkCache = networkCache; failures = new Dictionary<IServiceAddress, DateTime>(); pathToRoot = new Dictionary<string, IServiceAddress>(); logger = Logger.Network; }
public NetworkClient(IServiceAddress managerAddress, ServiceConnector connector, INetworkCache networkCache) : this(new IServiceAddress[] { managerAddress}, connector, networkCache) { }
public TcpProxyNetworkClient(TcpServiceAddress managerAddress, TcpServiceAddress proxyAddress, string password, INetworkCache cache) : base(managerAddress, new TcpProxyServiceConnector(proxyAddress, password), cache) { }
public PathConnection(RootService service, PathInfo pathInfo, IServiceConnector connector, IServiceAddress[] managerServers, INetworkCache cache, ServiceStatusTracker statusTracker) { this.service = service; this.pathInfo = pathInfo; treeSystem = new NetworkTreeSystem(connector, managerServers, cache, statusTracker); }
public PathConnection(RootService service, string pathName, IServiceConnector connector, IServiceAddress manager, INetworkCache networkCache) { this.service = service; this.pathName = pathName; treeSystem = new NetworkTreeSystem(connector, manager, networkCache); }
public TcpNetworkClient(TcpServiceAddress[] managerAddress, string password, INetworkCache cache) : base(managerAddress, new TcpServiceConnector(password), cache) { }
public NetworkClient(IServiceAddress managerAddress, ServiceConnector connector, INetworkCache networkCache) : this(new IServiceAddress[] { managerAddress }, connector, networkCache) { }