Note that there are some explanatory texts on larger screens.

plurals
  1. POUdpClient -- limited buffersize?
    primarykey
    data
    text
    <p>I'm having troubles with UdpClient in C#. I am streaming audio over the internet between two clients.</p> <p>On my microphone, with a sample rate of 16khz, I send UDP packets with audio with 6400 byte per packet. These never get through, except the last packet which is usally around 1200-3400 something since I close the recording. When I lower sample rate to 8khz, I send packets with 3200 byte payload. These always get through for some reason. </p> <p>So basically anything above 3200 gets botched (havn't tested an exact number but...) why on earth is this? I was thinking perhaps the UdpClient internal buffer is too small or something? Since I stream audio packets gets sent frequently. </p> <p>RECEIVE:</p> <pre><code>private void audioReceive(IAsyncResult asyn) { try { byte[] temp = audioSock.EndReceive(asyn, ref this.serverEP); this.waveProvider.AddSamples(temp, 0, temp.Length); this.textbox_display.Text = this.textbox_display.Text + " got bytes: " + temp.Length; audioSock.BeginReceive(new AsyncCallback(audioReceive), null); } catch (Exception ez) { MessageBox.Show("audioReceive: " + this.textbox_nick.Text + " " +ez.ToString()); } } </code></pre> <p>I can't find any obvious fault. (The asyn object to the function is null btw, I do not need to use a stateobject , but that shouldn't be related to this)</p> <p>I know UDP is not reliable, but considering every single 3200 sized packet get through and no 6400 size smells fishy to me, especially with max size is what, 64kb?</p> <p>Any ideas?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload