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

IWaitingClientTClient, TResultSendThenResponseAsync(ReadOnlyMemoryByte, CancellationToken) 方法

异步发送

Definition

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

参数

memory  ReadOnlyMemoryByte
要发送的数据,使用内存表示
cancellationToken  CancellationToken
取消令箭,用于取消操作

返回值

TaskResponsedData
返回的数据,类型为ResponsedData

异常

ClientNotConnectedException客户端没有连接
OverlengthException发送数据超长
Exception其他异常

参见