internal LocalRunspaceProvider(int timeoutSeconds, int maxRunspaces, PSLanguageMode? languageMode) { this._requests = new ConcurrentQueue<LocalRunspaceAsyncResult>(); this._callbacks = new ConcurrentQueue<LocalRunspaceAsyncResult>(); this._tracer = PowerShellTraceSourceFactory.GetTraceSource(); this._runspaceCache = new TimeBasedCache<Runspace>(timeoutSeconds); this._maxRunspaces = maxRunspaces; this._languageMode = languageMode; }
/// <summary>Creates a DhtAddressResolver Object.</summary> /// <param name="dht">The dht object to use for dht interactions.</param> /// <param name="ipop_namespace">The ipop namespace where the dhcp server /// is storing names.</param> public DhtAddressResolver(IDht dht, string ipop_namespace) { _dht = dht; _ipop_namespace = ipop_namespace; _cache = new TimeBasedCache<MemBlock, Address>(CLEANUP_TIME_MS); _attempts = new Dictionary<MemBlock, int>(); _queued = new Dictionary<MemBlock, bool>(); _mapping = new Dictionary<Channel, MemBlock>(); }
/// <summary>Creates a DhtAddressResolver Object.</summary> /// <param name="dht">The dht object to use for dht interactions.</param> /// <param name="ipop_namespace">The ipop namespace where the dhcp server /// is storing names.</param> public DhtAddressResolver(IDht dht, string ipop_namespace) { _dht = dht; _ipop_namespace = ipop_namespace; _cache = new TimeBasedCache <MemBlock, Address>(CLEANUP_TIME_MS); _attempts = new Dictionary <MemBlock, int>(); _queued = new Dictionary <MemBlock, bool>(); _mapping = new Dictionary <Channel, MemBlock>(); }
public ConeNat(TransportAddress ta, int timeout) { _external_ta = new TransportAddress[1] { ta }; _internal_ta = new TransportAddress[1] { ((SimulationTransportAddress) ta).Invert() }; _known_tas = _internal_ta; // TBC uses a staged GC, so values are still in after one timeout _allowed = new TimeBasedCache<TransportAddress, bool>(timeout / 2); _allowed.EvictionHandler += HandleEviction; _allow_inbound = false; }
/// <summary>Creates a DhtAddressResolver Object.</summary> /// <param name="dht">The dht object to use for dht interactions.</param> /// <param name="ipop_namespace">The ipop namespace where the dhcp server /// is storing names.</param> public DhtAddressResolver(IDht dht, string ipop_namespace) { _dht = dht; _ipop_namespace = ipop_namespace; _verified_cache = new TimeBasedCache<MemBlock, Address>(CLEANUP_TIME_MS); _incoming_cache = new TimeBasedCache<MemBlock, Address>(CLEANUP_TIME_MS); _attempts = new Dictionary<MemBlock, int>(); _queued = new Dictionary<MemBlock, bool>(); _mapping = new Dictionary<Channel, MemBlock>(); _udp_client = new UdpClient("127.0.0.1", 55123); }
public ConeNat(TransportAddress ta, int timeout) { _external_ta = new TransportAddress[1] { ta }; _internal_ta = new TransportAddress[1] { ((SimulationTransportAddress)ta).Invert() }; _known_tas = _internal_ta; // TBC uses a staged GC, so values are still in after one timeout _allowed = new TimeBasedCache <TransportAddress, bool>(timeout / 2); _allowed.EvictionHandler += HandleEviction; _allow_inbound = false; }
public OnDemandConnectionOverlord(Node node) : base(node) { _cache = new TimeBasedCache<Address, bool>(CLEANUP_TIME_MS); _cache.EvictionHandler += HandleEviction; }
/// <summary>When we get an eviction, we need to consider disconnecting the /// connection.</summary> protected void HandleEviction(object sender, TimeBasedCache<Address, bool>.EvictionArgs ea) { DelayedRemove(ea.Key, "No longer needed"); }
public OnDemandConnectionOverlord(Node node) : base(node) { _cache = new TimeBasedCache <Address, bool>(CLEANUP_TIME_MS); _cache.EvictionHandler += HandleEviction; }
/// <summary>When we get an eviction, we need to consider disconnecting the /// connection.</summary> protected void HandleEviction(object sender, TimeBasedCache <Address, bool> .EvictionArgs ea) { DelayedRemove(ea.Key, "No longer needed"); }
/// <summary>If there are no more entries in the cache, our mapping has, we /// will no longer allow inbound connections.</summary> private void HandleEviction(object sender, TimeBasedCache<TransportAddress, bool>.EvictionArgs ea) { _allow_inbound = _allowed.Count > 0; }
/// <summary>If there are no more entries in the cache, our mapping has, we /// will no longer allow inbound connections.</summary> private void HandleEviction(object sender, TimeBasedCache <TransportAddress, bool> .EvictionArgs ea) { _allow_inbound = _allowed.Count > 0; }
internal LocalRunspaceProvider(int timeoutSeconds, int maxRunspaces, PSLanguageMode? languageMode) { _runspaceCache = new TimeBasedCache<Runspace>(timeoutSeconds); _maxRunspaces = maxRunspaces; _languageMode = languageMode; }