Newsgroups : Borland : borland.public.delphi.internet.winsock : 2006 Jun : Re: UDP buffer problems

www.cryer.info
Managed Newsgroup Archive

Re: UDP buffer problems

Subject:Re: UDP buffer problems
Posted by:"Ben Hochstrasser" (bh..@tiscali123^h^h^h.ch)
Date:Wed, 21 Jun 2006 01:22:24

Silvia wrote:

> I have hundreds of UDP datagrams sent to the server. If I do not
> process the information received in the server I see that the
> server has received all the datagrams. However if I perform
> any operation or I make sleep the server each time a datagram is
> received I only receive 200 UDP datagrams, I loss a lot of
> datagrams.

Yep. UDP datagrams are just one frame long and are spit out without any
kind of handshake. Just like throwing a handful cookies at your dog. Some
will land on the floor...

You'd need some kind of list which is populated in the main thread (the one
that receives the UDP frames) and emptied by at least one worker thread
which does the data mangling and answering the client. And you need a
critical section to prevent simultaneous access to that "laundry list".

(That's about how I did a syslog daemon for windows)

--
Ben

Replies:

In response to:

www.cryer.info
Managed Newsgroup Archive