Re: 1000's UDP packets arrive same time problem
- From: Helge Jensen <helge.jensen@xxxxxxx>
- Date: Sun, 15 May 2005 15:55:34 +0200
ramta jatt via .NET 247 wrote:
I have problem of packet drop out.
UDP transfers are unreliable, packets can be dropped at any time. Probably your network is congested or you cannot handle the amount of input fast enough.
How much is the buffer size for UDP packets? Can I chnage it? My app can not allow droping of packets.
You should really make a protocol on top of UDP to ensure against packet loss.
With the amounts of data that you seem to be sending are you sure you don't just want to be able to detect that packages have been lost?
Exactly what can you do if a package is lost?
Second problem is, the packets contain different type of information and will be processed by different Threads. I f I use a queue, I will be having a thread-safe problem.
Make yourself a thread-safe Producer/Consumer queue. You can use a Mutex (for example) to block readers untill data is available.
Please suggest me some design that will help me to solve above problems. I am using vb.net
It sounds like you need to be able to offload packages from the OS as fast as possible. Make the routine that receives packages queue the raw package so it does as little work as possible. Have some lower priority threads for processing the genberated queue. Not that this might cause the queue to grow indefinatly, with disasterous results, if you dont have enough processing power to process it.
You can also have a look at asynchroneous IO, but that's going to generate a radically different way of coding your IO, and it's easy to get wrong. It's not too bad if you just queue the incoming packages, but still...
Possibly you could think about coding the performance-bound IO in C# to skip the VB interpretation? (I know close to nothing of VB, and you should check that you actually gain anything by changing this part to C#/... yourself).
-- Helge Jensen mailto:helge.jensen@xxxxxxx sip:helge.jensen@xxxxxxx -=> Sebastian cover-music: http://ungdomshus.nu <=- .
- Follow-Ups:
- Re: 1000's UDP packets arrive same time problem
- From: news.sbcglobal.net
- Re: 1000's UDP packets arrive same time problem
- References:
- 1000's UDP packets arrive same time problem
- From: ramta jatt via . NET 247
- 1000's UDP packets arrive same time problem
- Prev by Date: Re: i want to use arabic and english on the same winform in .net
- Next by Date: Re: Class Hierarchy design problems...
- Previous by thread: 1000's UDP packets arrive same time problem
- Next by thread: Re: 1000's UDP packets arrive same time problem
- Index(es):
Relevant Pages
|