Newsgroups : Borland : borland.public.delphi.internet.winsock : 2006 May : Re: Indy UDP readevent doesn't use dual core/multi processors?

www.cryer.info
Managed Newsgroup Archive

Re: Indy UDP readevent doesn't use dual core/multi processors?

Subject:Re: Indy UDP readevent doesn't use dual core/multi processors?
Posted by:"Remy Lebeau (TeamB)" (no.spam@no.spam.com)
Date:Wed, 3 May 2006 11:53:28

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

> After looking and testing with the indy 10 snapshot, I think I
> misunderstood bindings at first. Is a binding defined by the host
> address and IP (the listening server)? Regardless of the source ip/port?

A Binding is the IP/Port that a server listens on.  That is the IP/Port that
clients connect to (or, in the case of UDP, the IP/port that clients send
their data to).

> So does the new Indy snapshot UDPServer now have support for
> separate threads per binding

No.  There is no way to do that.

> which means listening on different host IP addresses?

That is what the Bindings collection is for.  Each Binding can listen for
connections on a different IP/Port on the server machine.

> Or is it now possible to have a thread per virtual connection (with
> same destination port) with a source client

No.

> if the source IP and/or port are different per thread?

No, because there is no way to determine the source IP/Port until the data
is actually read from the listening socket.

> I am getting the feeling that due to the UDP nature it's just impossible
> to have threads per "connection" like the TCPserver has.

The only way that TIdTCPServer is able to spawn separate threads per
connection in the first place is because the connections have to be accepted
by the server via a call to accept(), which returns a new SOCKET handle for
that connection.  Each thread thus has its own unique SOCKET handle
associated with it.  UDP, on the other hand, does not do that at all.  There
is no call to accept().  There is no unique SOCKET handle for each
connection to a particular client.

> A) To use multiple cores with udpserver I need to have multiple
> (one per core) host IP adresses on the server computer and bind them?

Yes

> B) I need to handle the incoming packets myself in the onudpread event
> and check for myself what the source IP/port is in order to react
different
> to each source?

Yes.


Gambit

Replies:

In response to:

www.cryer.info
Managed Newsgroup Archive