public void Listen() { serverOn = true; while (serverOn) { var buffer = new byte[1024]; EndPoint client = new IPEndPoint(IPAddress.None, 53); var count = MainSocket.ReceiveFrom(buffer, ref client); var dnsFrame = new DNSFrame(buffer, count); Notify(dnsFrame, client); } }
public void Notify(DNSFrame frame, EndPoint client) { MySubscribers.ForEach(s => s.Updata(frame, client)); }