public void Start() { UdpStats.Reset(); UdpNodeManager.Initialize(); this.TcpTester.PopulateNodes(); this.Showing = Settings.Get <bool>("udp"); this.Timer_1_Second = Time.Now; this.Timer_1_Minute = Time.Now; this.Timer_15_Minutes = Time.Now; this.Sock = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); this.Sock.Blocking = false; this.Sock.Bind(this.EndPoint); }
public void ServiceUdp(ulong time) { this.SendReceive(); while (this.data_in.Count > 0) { try { UdpProcessor.Eval(this.data_in.Dequeue(), this, time); } catch { } } if ((this.Timer_1_Second + 1000) < time) { this.Timer_1_Second = time; this.firewall_tests.ForEachWhere(x => x.Stop(), x => (x.Time + 10000) < time); this.firewall_tests.RemoveAll(x => x.Completed); if (this.TcpTester.IsTesting) { this.TcpTester.TestNext(this); } else if (this.Showing) { this.Push(time); } } if ((this.Timer_1_Minute + 60000) < time) { this.Timer_1_Minute = time; this.TcpTester.Timeout(); UdpNodeManager.Expire(time); } if ((this.Timer_15_Minutes + 900000) < time) { this.Timer_15_Minutes = time; UdpNodeManager.Update(time); ServerCore.Log("local node list updated [" + UdpStats.SENDINFO + ":" + UdpStats.ACKINFO + ":" + UdpStats.ADDIPS + ":" + UdpStats.ACKIPS + "]"); UdpStats.Reset(); } }