public ItemFilterWindow(TickSpan span, int limit) { MemorySpan = span; Limit = limit; }
public TimeWindowDictionary(TickSpan span) { MemorySpan = span; }
public override string ToString() { return($"delta {TickSpan.DebugText( DeltaToNow )}"); }
private void Run() { var buf = new byte[65536]; var buf2 = new byte[65536]; try { MulticastSocket.BeginReceiveFrom(buf, 0, buf.Length, SocketFlags.None, ref MLEp, new AsyncCallback(ReceiveMulticast), buf); DiscoverDevices(); Thread.Sleep(1000); while (!Terminated) { try { DiscoverAction.Do(DiscoverDevices); GetExternalAddressAction.Do(delegate { if (GetExternalAddressAction.Frequency.ToSeconds < 1.0) { GetExternalAddressAction.Frequency = TickSpan.Seconds(60 * 30); GetExternalAddressAction.Start(); } if (WANIPConnectionsCtlInfo.Count > 0) { ControlInfo ci; lock ( WANIPConnectionsCtlInfo ) { ci = WANIPConnectionsCtlInfo.Values.First(); } RequestExternalIpAddress(ci); } }); ExternalPortMappingAction.Do(delegate { if (ExternalPortMappingAction.Frequency.ToSeconds < 1.0) { ExternalPortMappingAction.Frequency = TickSpan.Seconds(LeaseMapDurationSeconds - 200); ExternalPortMappingAction.Start(); } if (WANIPConnectionsCtlInfo.Count > 0) { UpdatePortMapping("TCP"); UpdatePortMapping("UDP"); } }); Thread.Sleep(1000); } catch (ThreadAbortException ex) { Logging.Log(ex); } catch (Exception ex) { Logging.Log(ex); } } } finally { Terminated = true; } }
public PeriodicAction(TickSpan freq, bool hastimedout) : this(freq.ToMilliseconds, hastimedout) { }
public PeriodicAction(TickSpan freq) : this(freq.ToMilliseconds, false) { }
public override string ToString() { return("TickCounter: delta " + TickSpan.DebugText(DeltaToNow)); }
public PeriodicLogger(DebugUtils.LogLevels level, int freqsec) { LogLevel = level; LogAction = new PeriodicAction(TickSpan.Seconds(freqsec)); }
public PeriodicLogger(int freqsec) { LogAction = new PeriodicAction(TickSpan.Seconds(freqsec)); LogLevel = DebugUtils.LogLevels.DebugData; }