Article View: borland.public.cppbuilder.internet.socket
Article #327Re: (INDY) UDP binding and broadcast
From: Remy Lebeau (TeamB)
Date: Tue, 15 Apr 2008 16:48
Date: Tue, 15 Apr 2008 16:48
26 lines
1869 bytes
1869 bytes
"JohnG" <whatis@email.com> wrote in message
news:4804bc99@newsgroups.borland.com...
> I am having issues with UDP binding and UDP broadcasts.
> It appears that the binding is not enforced when broadcasting
> messages. When I bind to an IP\NIc in a multi nic system
> the message is sent across both connections and received
> by connected computers.
The Broadcast() method broadcasts to "255.255.255.255" by default, which
sends to all available subnets. If you are using Indy 10, then Broadcast()
has an optional IP parameter so you can narrow down the broadcast to a
specific subnet (Indy 9 does not have that option), ie:
void __fastcall TForm1::ButtonSendMessageClick(TObject *Sender)
{
if( !IdUDPServer->Active )
ShowMessage("UDP not enabled.");
// 10.90.80.255 = broadcast address of the "10.90.80.xxx" subnet
IdUDPServer->Broadcast(EditMessage->Text, 40, "10.90.80.255");
}
Gambit
Technical Details
Message-ID:
<4804dc70$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!news.isoc.lu!newsgroups.borland.com!not-for-mailReferences:
<4804bc99@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,7b3ef48fe39eea8e X-Google-Attributes: gid11508e,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com> Newsgroups: borland.public.cppbuilder.internet.socket References: <4804bc99@newsgroups.borland.com> Subject: Re: (INDY) UDP binding and broadcast Date: Tue, 15 Apr 2008 09:48:35 -0700 Lines: 28 Organization: Lebeau Software X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.3138 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198 NNTP-Posting-Host: 207.178.157.90 Message-ID: <4804dc70$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1208278128 207.178.157.90 (15 Apr 2008 09:48:48 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!news.isoc.lu!newsgroups.borland.com!not-for-mail