|
-
April 29th, 2010, 12:33 PM
#3
Re: how to open sockets on multiple network adapters..??
 Originally Posted by hoxsiew
Binding each socket to its respective adapters should be sufficient.
I tend to disagree with this, at least with respect to outgoing (i.e., client) connections. For a multi-homed system (i.e., a system with multiple network cards) with a Windows OS, and with respect to outgoing connections, a call to bind() will have no effect on the choice of which card will be used to establish the connection. Rather, the choice of card will be made by the OS using the routing table. The OS will make its decision by comparing the routing table to the destination IP, to choose the card that seems most appropriate for the destination.
See this blog for an example on how to create an entry in the routing table. It's written for WinCE but the principles are similar: "Routing IP traffic via specified adapter" at
http://ce4all.blogspot.com/2007/05/r...specified.html
OTOH, for accepting incoming connections (i.e., via listen() and accept()), a call to bind() works as expected.
Mike
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|