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

UdpSessionBaseProtectedSendAsync(EndPoint, ReadOnlyMemoryByte, CancellationToken) 方法

异步发送数据到指定的端点。 该方法通过适配器转发数据,如果适配器未设置,则采用默认发送方式。

Definition

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

参数

endPoint  EndPoint
要发送数据到的目标端点。
memory  ReadOnlyMemoryByte
待发送的字节数据。
cancellationToken  CancellationToken
可取消令箭

返回值

Task
返回一个任务,表示异步操作的结果。

参见