Article View: borland.public.cppbuilder.internet.socket
Article #332Re: (INDY) UDP binding and broadcast
From: Remy Lebeau (TeamB)
Date: Tue, 15 Apr 2008 19:08
Date: Tue, 15 Apr 2008 19:08
35 lines
2556 bytes
2556 bytes
"johnG" <whatis@email.com> wrote in message
news:4804eb76$1@newsgroups.borland.com...
> Does it broadcast to all subnets accessible by a specific (physical
> network) network adapter, or all subnets across all adapters?
Using "255.255.255.255" as the destination IP will send the data on all
physical adapters. This is documented by Microsoft:
sendto() function
http://msdn2.microsoft.com/en-us/library/ms740148.aspx
"To send a broadcast (on a SOCK_DGRAM only), the address pointed to by
the to parameter can be constructed to contain the special IPv4 address
INADDR_BROADCAST (defined in Winsock2.h), together with the intended port
number. If the address pointed to by the to parameter contains the
INADDR_BROADCAST address and intended port, then the broadcast will be sent
out on all interfaces to that port.
If the broadcast should be sent out only on a specific interface, then
the address pointed to by the to parameter should contain the subnet
broadcast address for the interface and the intended port. For example, an
IPv4 network address of 192.168.1.0 with a subnet mask of 255.255.255.0
would use a subnet broadcast address of 192.168.1.255."
INADDR_BROADCAST is defined as $FFFFFFFF, aka "255.255.255.255".
> Sorry, using indy 9.0.50,but is upgrading the only way to
> prevent sending messages across all network adapters?
Yes, unless you manually re-write Broadcast() and then re-compile Indy.
Gambit
Technical Details
Message-ID:
<4804fd35$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!news.isoc.lu!newsgroups.borland.com!not-for-mailReferences:
<4804bc99@newsgroups.borland.com> <4804dc70$1@newsgroups.borland.com> <4804eb76$1@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> <4804dc70$1@newsgroups.borland.com> <4804eb76$1@newsgroups.borland.com> Subject: Re: (INDY) UDP binding and broadcast Date: Tue, 15 Apr 2008 12:08:24 -0700 Lines: 37 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: <4804fd35$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1208286517 207.178.157.90 (15 Apr 2008 12:08:37 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!news.isoc.lu!newsgroups.borland.com!not-for-mail