how to bind to a network card #2298
-
My PC has multiple network cards, how to select one of them when I establishing TCP or UDP connections. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
I suggest you read some networking. |
Beta Was this translation helpful? Give feedback.
I suggest you read some networking.
Your PC has an operating system
Your OS has a TCP/IP stack
Your cards are connected to networks
Each network has a network address and each card has a host address
When you start a listener, you choose on what address you will listen. This you can control. See the examples.
When you start a connection, your stack decides on which interface to exit based on the destination address and its routing table. This you can't, and usually don't need to.
In IPv6 there are other options we do not support