PackageEventArgs.cs 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Net;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. namespace ToolsClassLibrary.UDP
  8. {
  9. /// <summary>
  10. /// 数据包事件数据
  11. /// </summary>
  12. public class PackageEventArgs : EventArgs
  13. {
  14. /// <summary>
  15. /// 网络消息包
  16. /// </summary>
  17. public UdpPacket udpPackage { get; set; }
  18. /// <summary>
  19. /// 网络消息包组
  20. /// </summary>
  21. public UdpPacket[] udpPackages { get; set; }
  22. /// <summary>
  23. /// 远程IP
  24. /// </summary>
  25. public IPEndPoint RemoteIP { get; set; }
  26. /// <summary>
  27. /// 是否已经处理
  28. /// </summary>
  29. public bool IsHandled { get; set; }
  30. /// <summary>
  31. /// 创建一个新的 PackageEventArgs 对象.
  32. /// </summary>
  33. public PackageEventArgs(UdpPacket package, IPEndPoint RemoteIP)
  34. {
  35. this.udpPackage = package;
  36. this.RemoteIP = RemoteIP;
  37. this.IsHandled = false;
  38. }
  39. }
  40. }