Re: Networks and wireless etc
- From: "Alun Jones [MSFT]" <alunj@xxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 27 Jun 2005 15:47:21 -0700
"Eugene Gershnik" <gershnik@xxxxxxxxxxx> wrote in message
news:etrta3CeFHA.2688@xxxxxxxxxxxxxxxxxxxxxxx
> Simon Jefferies wrote:
>> Hello,
>>
>> Please can you tell me if I'm doing this right or not?
>>
>> I'm trying to get winsock to use the relevant network adapter to
>> connect to an IP address. I have enumerated the list of devices and
>> have e.g. network card, wireless network and loopback (using the
>> GetAdaptersAddresses() WIN32 function). Do I simply use the SOCKADDR
>> structure?
>
> bind() to a sepcific local address before connecting.
Binding will not directly affect which NIC is chosen to route outgoing
traffic.
Changing the information in the routing table will do that. Binding is only
an association between an IP network interface and a socket; while that IP
network interface is associated with a NIC, the NIC that is chosen to send a
packet out on depends on the _destination_ of that packet.
Thinking a little on this, it's perfectly sensible - if you have two
physically separate networks that your machine can get to, the only way to
get to network one is through the card that is connected to network one.
That's what your routing table is for, to tell the system where to send
packets for various network destinations.
Alun.
~~~~
--
Software Design Engineer, Internet Information Server (FTP)
This posting is provided "AS IS" with no warranties, and confers no rights.
.
- Follow-Ups:
- Re: Networks and wireless etc
- From: Eugene Gershnik
- Re: Networks and wireless etc
- References:
- Networks and wireless etc
- From: Simon Jefferies
- Re: Networks and wireless etc
- From: Eugene Gershnik
- Networks and wireless etc
- Prev by Date: Re: IFS LSP Sample
- Next by Date: Re: Networks and wireless etc
- Previous by thread: Re: Networks and wireless etc
- Next by thread: Re: Networks and wireless etc
- Index(es):
Relevant Pages
|
Loading