我在使用 SslStream.WriteAsync 时遇到了一个恼人的问题
这是代码
public void Send(PacketWriter writer)
{
var buffer = writer.GetWorkspace();
_sslStream.WriteAsync(buffer, 0, buffer.Length);
}
当以极高的速度写入数据时,它告诉我
The beginwrite method cannot be called when another write operation is pending
[注意]:我的意思是高速这样的东西
for (var i = 0 ; i <= 1000; i++)
{
Send(somedata);
}