Board index » delphi » Indy - broadcast

Indy - broadcast

Hi,

Something that doesnt work.
I tryed the SEND methode and it works perfect but when I try the broadcast
method nothing happens.
Is this a bug or am I doing something wrong?

Nicolas

 

Re:Indy - broadcast


Nicolas,

Try setting the host to "255.255.255.255" when broadcasting.

Geoff

Quote
"Nicolas Six" <Softw...@fasttel.be> wrote in message

news:3b49ccac$1_2@dnews...
Quote
> Hi,

> Something that doesnt work.
> I tryed the SEND methode and it works perfect but when I try the broadcast
> method nothing happens.
> Is this a bug or am I doing something wrong?

> Nicolas

Re:Indy - broadcast


Quote
"Geoff Lawrence" <geoff_j_lawre...@hotmail.com> wrote in message

news:3b4b5e52_1@dnews...

Quote
> Nicolas,

> Try setting the host to "255.255.255.255" when broadcasting.

Isn't this broadcast address for ALL IP addresses???
why not something like this 192.168.0.255 if your network ID is 192.168.0,
and 122.12.255.255 if your network id is 122.12 ?

Robert

Re:Indy - broadcast


Quote
"Robert Petrunic" <rob...@petrunic.com> wrote in message

news:3b4da163_1@dnews...

Quote
> "Geoff Lawrence" <geoff_j_lawre...@hotmail.com> wrote in message
> news:3b4b5e52_1@dnews...
> > Try setting the host to "255.255.255.255" when broadcasting.

TIdUDPBase contains a Broadcast method that already does this using:

  IdUDP1.Broadcast(sData, iPort).

Quote
> Isn't this broadcast address for ALL IP addresses???

Yes, but only on the local network.

Quote
> why not something like this 192.168.0.255 if your network ID is 192.168.0,
> and 122.12.255.255 if your network id is 122.12 ?

This is narrow cast<g>. You could try:

  IdUDP1.BroadcastEnabled := True;
  IdUDP1.Send('192.168.0.255', iPort, sData);
  IdUDP1.BroadcastEnabled := False;

hth...

Other Threads