The new forums will be named Coin Return (based on the most recent vote)! You can check on the status and timeline of the transition to the new forums here.
The Guiding Principles and New Rules document is now in effect.

UDP Program with 2 Ethernet Cards

DrunkMcDrunkMc Registered User regular
edited November 2007 in Help / Advice Forum
At the moment I have a UDP program which does simple sends and recieves. I just use the Socket() command to get my current socket.

I now have to make it so I can specify which ethernet port on my machine to use.

Any idea on how to do this?

Thanks! This is in C++ btw.

DrunkMc on

Posts

  • DrunkMcDrunkMc Registered User regular
    edited November 2007
    It looks like I can do it with a simple bind() command. I never got into the routine of using bind with UDP, I just let the system figure it out. It looks like that I can use bind though to specify the correct IP address to send from.

    DrunkMc on
  • PirateJonPirateJon Registered User regular
    edited November 2007
    Not a programmer, but since I pretty much search google for a living, I did a run and got a bunch of forum posts about "specifying the source IP on bind" and this bit from MS on NLA which is at least spells out the old methods to do what you want, even if it doesn't tell you how to implement them.
    In the past, developers had to obtain information about a logical network interface, and therefore make decisions about network connectivity, based on a multitude of disparate network information. In those circumstances, developers had to choose the appropriate network interface based on the IP address, the subnet of the interface, the Domain Name System (DNS) name associated with the interface, the MAC address of a NIC, a wireless network name, or other network information.


    - doh! too late!

    PirateJon on
    all perfectionists are mediocre in their own eyes
Sign In or Register to comment.