SerialPortClientBaseProtectedSendAsync(ReadOnlyMemoryByte, CancellationToken) 方法
异步发送数据,通过适配器模式灵活处理数据发送。
命名空间: TouchSocket.SerialPorts程序集: TouchSocket.SerialPorts (在 TouchSocket.SerialPorts.dll 中) 版本:4.1.4.7+7f7e1f78093c99347956e09330d5d7aca1d2bdf2
protected Task ProtectedSendAsync(
ReadOnlyMemory<byte> memory,
CancellationToken cancellationToken
)
Protected Function ProtectedSendAsync (
memory As ReadOnlyMemory(Of Byte),
cancellationToken As CancellationToken
) As Task
member ProtectedSendAsync :
memory : ReadOnlyMemory<byte> *
cancellationToken : CancellationToken -> Task
- memory ReadOnlyMemoryByte
- 待发送的只读字节内存块。
- cancellationToken CancellationToken
- 可取消令箭
Task一个异步任务,表示发送操作。