Newsgroups : Borland : borland.public.delphi.internet.winsock : 2007 Nov : Re: Multiple bindings with TidUDPServer doesn't work?

www.cryer.info
Managed Newsgroup Archive

Re: Multiple bindings with TidUDPServer doesn't work?

Subject:Re: Multiple bindings with TidUDPServer doesn't work?
Posted by:"Remy Lebeau (TeamB)" (no.spam@no.spam.com)
Date:Fri, 9 Nov 2007 09:57:09

"mike" <johnson40@zonnet.nl> wrote in message
news:47341484$1@newsgroups.borland.com...

> I use Indy 10.1.5

That is a very old release.  Indy 10 has undergone several internal rewrites
since that version.  I suggest you upgrade to the current 10.2.3 snapshot
and see if the problem continues..

> This would still mean that the same onudpread event is
> triggered right?

Yes.  But the individual Bindings now run in their own threads, so they
can't block each other anymore (unless you perform a synchronized operation,
of course).  That was not the case in old versions.  There was just 1 thread
that stored all of the Bindings into an array and then looped through it
reading from the sockets one at a time, so one socket could block the rest.

> ThreadedEvent is set to false

By doing that, it forces the OnUDPRead event handler to be synchronized with
the main thread.  So you actually lose the benefit of the server being
multi-threaded internally, since only one thread at a time will be able to
trigger the event handler.  You may want to consider changing your code to
allow ThreadedEvent to be true instead.

> To be safe I changed the code to:

Since that code does not access anything outside the event handler, that
would benefit from setting ThreadedEvent to true.


Gambit

Replies:

In response to:

www.cryer.info
Managed Newsgroup Archive