SendingEventArgs.cs 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. //------------------------------------------------------------------------------
  2. // 此代码版权(除特别声明或在XREF结尾的命名空间的代码)归作者本人若汝棋茗所有
  3. // 源代码使用协议遵循本仓库的开源协议及附加协议,若本仓库没有设置,则按MIT开源协议授权
  4. // CSDN博客:https://blog.csdn.net/qq_40374647
  5. // 哔哩哔哩视频:https://space.bilibili.com/94253567
  6. // Gitee源代码仓库:https://gitee.com/RRQM_Home
  7. // Github源代码仓库:https://github.com/RRQM
  8. // API首页:https://www.yuque.com/rrqm/touchsocket/index
  9. // 交流QQ群:234762506
  10. // 感谢您的下载和使用
  11. //------------------------------------------------------------------------------
  12. //------------------------------------------------------------------------------
  13. using TouchSocket.Core;
  14. namespace TouchSocket.Sockets
  15. {
  16. /// <summary>
  17. /// 发送事件
  18. /// </summary>
  19. public class SendingEventArgs : TouchSocketEventArgs
  20. {
  21. /// <summary>
  22. /// 构造函数
  23. /// </summary>
  24. /// <param name="buffer"></param>
  25. /// <param name="offset"></param>
  26. /// <param name="length"></param>
  27. public SendingEventArgs(byte[] buffer, int offset, int length)
  28. {
  29. Buffer = buffer;
  30. Offset = offset;
  31. Length = length;
  32. IsPermitOperation = true;
  33. }
  34. /// <summary>
  35. /// 数据缓存区,该属性获取来自于内存池,所以最好不要引用该对象,可以同步使用该对象
  36. /// </summary>
  37. public byte[] Buffer { get; }
  38. /// <summary>
  39. /// 缓存偏移
  40. /// </summary>
  41. public int Offset { get; }
  42. /// <summary>
  43. /// 数据长度
  44. /// </summary>
  45. public int Length { get; }
  46. }
  47. }