IUdpDefaultSender.cs 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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 System;
  14. using System.Net;
  15. using System.Threading.Tasks;
  16. namespace TouchSocket.Sockets
  17. {
  18. /// <summary>
  19. /// 具有直接发送功能
  20. /// </summary>
  21. public interface IUdpDefaultSender : ISenderBase
  22. {
  23. /// <summary>
  24. /// 绕过适配器,直接发送字节流
  25. /// </summary>
  26. /// <param name="endPoint">目的终结点</param>
  27. /// <param name="buffer">数据缓存区</param>
  28. /// <param name="offset">偏移量</param>
  29. /// <param name="length">数据长度</param>
  30. /// <exception cref="NotConnectedException">客户端没有连接</exception>
  31. /// <exception cref="OverlengthException">发送数据超长</exception>
  32. /// <exception cref="Exception">其他异常</exception>
  33. void DefaultSend(EndPoint endPoint, byte[] buffer, int offset, int length);
  34. /// <summary>
  35. /// 绕过适配器,直接发送字节流
  36. /// </summary>
  37. /// <param name="endPoint">目的终结点</param>
  38. /// <param name="buffer">数据缓存区</param>
  39. /// <param name="offset">偏移量</param>
  40. /// <param name="length">数据长度</param>
  41. /// <exception cref="NotConnectedException">客户端没有连接</exception>
  42. /// <exception cref="OverlengthException">发送数据超长</exception>
  43. /// <exception cref="Exception">其他异常</exception>
  44. Task DefaultSendAsync(EndPoint endPoint, byte[] buffer, int offset, int length);
  45. }
  46. }