UDPSocket Buffer Size?

Hi guys,

I’m running into a little issue with many many UDP Packets coming in at full speed (Broadcast, by the way). Each packet is about 600 bytes in size, I am actually getting about 640 Packets per second (worst case while testing here), and the UDP Socket seems to miss some of them… If I get a lot less (ie. the sender is only in keep-alive mode, which is 16 packets every 4 seconds all is good. It also works fine with up to 120 Packets per second… Hence I am wondering if the UDP Buffer is just running full and I am missing packets on the input side.
Any input welcome :slight_smile:

Cheers,
Denis

just had a look at the activity monitor and a received packet counter in my app - activity monitor said the app received 12000 packets, wheras the internal counter (which increments everytime the data available event fires) is saying it received about 3300 packets…

So definately something related to the udp socket…

After another test it looks like some of the packets actually que up… if I stop the app that sends the packets, they still count up - altough not as high as they should. So seems like theres 2 things going on:
UDPsocket buffer is too small - and
dataavailable event not firing fast enough. It isnt even firing fast enough if it only contains my own counter (mPacketsReceived = mPacketsReceived+1)

Any ideas? This is actually supposed to be a network troubleshooting app, which is not usefull if it can not withstand that amount of packets :wink:

cheers,
denis

[quote=66238:@Denis Hessberger]After another test it looks like some of the packets actually que up… if I stop the app that sends the packets, they still count up - altough not as high as they should. So seems like theres 2 things going on:
UDPsocket buffer is too small - and
dataavailable event not firing fast enough. It isnt even firing fast enough if it only contains my own counter (mPacketsReceived = mPacketsReceived+1)

Any ideas? This is actually supposed to be a network troubleshooting app, which is not usefull if it can not withstand that amount of packets :wink:

cheers,
denis[/quote]

Add a timer with a very low period that calls poll? :frowning:

I just checked with plugin functions:

MsgBox str(UDPSocket1.OptionSendBufferSizeMBS)+" "+str(UDPSocket1.OptionReceiveBufferSizeMBS)

Send buffer size is 9216 and receive buffer 196724.

UDPSocket1.OptionSendBufferSizeMBS = 10241024
UDPSocket1.OptionReceiveBufferSizeMBS = 1024
1024

This way I just increased the buffer size here.

I wrote some feedback cases: 32342, 32343, 32344.

Yes, that is a workaround, which also works around the buffer size issue, since the buffer is cleared as soon as the data available event fires and data is read. Still, it would be great if the socket could handle that itself… :slight_smile:
Cheers and thanks!

Denis