目前我在做:
WebSocketReceiveResult result = await Conn.ReceiveAsync(readBuffer, token);
for (int i = 1; i <= result.Count; i++)
{
if (CurrentPosition+i > ProcessedPosition)
{
Console.ForegroundColor = ConsoleColor.Blue;
}
else
{
Console.ForegroundColor = ConsoleColor.Cyan;
}
Console.Write(readBuffer.Array[CurrentPosition+i]);
Console.ResetColor();
}
CurrentPosition += result.Count;
我甚至在缓冲区中选择了正确的位置?我如何逐字节地分析它?