Some answers come truncated when it is very long.
For example:
await client.Publish(new AmiMessage { { "Action", "PJSIPShowContacts" } });
var nrBytes = this.stream.Read(bytes, 0, bytes.Length);
if (nrBytes == 0)
{
yield break; // EOF
}
this.readBuffer = this.readBuffer.Append(bytes.Slice(0, nrBytes));
this.DataReceived?.Invoke(this, new DataEventArgs(bytes.Slice(0, nrBytes)));
var nrBytes = this.stream.Read(bytes, 0, bytes.Length);
if (nrBytes == 0)
{
yield break; // EOF
}
this.readBuffer = this.readBuffer.Append(bytes.Slice(0, nrBytes));
this.DataReceived?.Invoke(this, new DataEventArgs(bytes.Slice(0, nrBytes)));
But it is inaccurate, since you do not know when you will need a higher value.