一款简单易用的基础网络通讯组件库。

IUdpClientSenderSendAsync(EndPoint, ReadOnlyMemoryByte, CancellationToken) 方法

异步组合发送数据。

该发送会经过适配器封装,具体封装内容由适配器决定。

Definition

命名空间: TouchSocket.Sockets
程序集: TouchSocket (在 TouchSocket.dll 中) 版本:4.0.0-beta.143+5fcca7a4e70968794985dc3793adc50531308be6
C#
Task SendAsync(
	EndPoint endPoint,
	ReadOnlyMemory<byte> memory,
	CancellationToken cancellationToken = default
)

参数

endPoint  EndPoint
远程终结点
memory  ReadOnlyMemoryByte
只读内存块,包含待发送的数据
cancellationToken  CancellationToken  (Optional)
可取消令箭

返回值

Task
一个表示异步操作的Task对象

异常

OverlengthException发送数据超长
Exception其他异常

参见