Re: Networks and wireless etc



"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.


.



Relevant Pages

  • alt.2600 FAQ Revision .014 (2/4)
    ... One type of firewall is the packet filtering firewall. ... Dropping packets instead of rejecting them greatly increases the time required to scan your network. ... Port scanning UDP ports is much slower than port scanning TCP ports. ... Chartreuse Use the electricity from your phone line Cheese Connect two phones to create a diverter Chrome Manipulate Traffic Signals by Remote Control ...
    (alt.2600)
  • RE: Freebsd Theme Song
    ... from the network into the ethernet receiver. ... It takes a certain amount of time to get the packet out of ... At low data rates polling is less ... >Subject: Re: Freebsd Theme Song ...
    (freebsd-questions)
  • Re: [9fans] Do we have a catalog of 9P servers?
    ... network layer data units, ergo, NAT again. ... The "packet ...
    (comp.os.plan9)
  • Re: very slow convergence of ntp to correct time.
    ... Many years ago the Proteon routers dropped the first packet ... David> after the cache timed out; ... cause issues for others when they are reconfiguring part of the network. ...
    (comp.protocols.time.ntp)
  • Re: [PATCH 1/1] network memory allocator.
    ... Kevent network AIO uses usual alloc_skb, naio is called when packet is ... data and main system can work with that free memory. ... You do not see the point of network tree allocator. ...
    (Linux-Kernel)

Loading