Newsgroups : Borland : borland.public.delphi.internet.winsock : 2006 Apr : Re: setting the local IP address

www.cryer.info
Managed Newsgroup Archive

Re: setting the local IP address

Subject:Re: setting the local IP address
Posted by:"Remy Lebeau (TeamB)" (no.spam@no.spam.com)
Date:Mon, 17 Apr 2006 10:59:54

"Danna Tabak" <tabak_danna@emc.com> wrote in message
news:4443b39b$1@newsgroups.borland.com...

> I would like to send UDP broadcasts through two different
> IP addresses. The IP addresses are statically assigned to two
> separate physical ethernet cards. I am using TIdUDPClient.

You need to set the Binding.IP property, *and* call the Binding.Bind()
method, in order to dynamically change the outbound IP of each transmission.

> Binding.Assign(source)

By itself, that will not have any effect if the Binding is already bound to
a socket.  You would have to call the Binding's CloseSocket() or
AllocateSocket() method as well.

> When I put breakpoints in the Indy source code, it appears that the
> binding used to send the packet has the correct IP address.

Changing the properties does not change the underlying socket automatically.


Gambit

Replies:

In response to:

www.cryer.info
Managed Newsgroup Archive