UDP broadcast source address when > 1 NIC
- From: "Dave Lowther" <davel@xxxxxxxxx>
- Date: Fri, 19 Aug 2005 10:19:57 +0100
My PC (XP Pro SP2) has two Ethernet interfaces, 10.0.0.6 and 192.168.0.200,
both IPs are static.
When I broadcast a UDP datagram using sendto() and a destination of
255.255.255.255, it sends the UDP datagram out on both Ethernet interfaces
which is what I wanted.
Unfortunately it uses the same IP source address (192.168.0.200) on both
interfaces, which isn't what I wanted.
I expected it to send the broadcast from the 10.0.0.6 interface with a
source address of 10.0.0.6.
The receiver of my broadcast uses recvfrom() and then sendto() to send a
directed reply to the broadcast, but of course this doesn't work on the
10.0.x.y network because the reply is being sent to 192.168.0.200.
I'm thinking that I'll have to enumerate the network interfaces and
broadcast on each one using sendto() with the sub-net broadcast address.
Is there any other way to get Windows to send out the broadcast on each
Ethernet interface but use the IP address assigned to the interface as the
source IP ?
TIA
Dave.
.
- Follow-Ups:
- Re: UDP broadcast source address when > 1 NIC
- From: Dave Lowther
- Re: UDP broadcast source address when > 1 NIC
- Prev by Date: Netowrk Connections Issue
- Next by Date: Re: IOCP with graceful close
- Previous by thread: Netowrk Connections Issue
- Next by thread: Re: UDP broadcast source address when > 1 NIC
- Index(es):
Relevant Pages
|