Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The response is truncated, when the message exceeds the byte length(4096) #21

Open
maurobernal opened this issue Oct 10, 2023 · 0 comments

Comments

@maurobernal
Copy link

Some answers come truncated when it is very long.
For example:
await client.Publish(new AmiMessage { { "Action", "PJSIPShowContacts" } });

I need modify in AmiClient.cs
` try
{
var bytes = new Byte[4096];

 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)));

}`
to
try
{
var bytes = new Byte[12288];

 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant