• February 05, 2023, 07:43:24 PM

Login with username, password and session length

Author Topic: How to programming for selection the network adapter.  (Read 5009 times)


  • Newbie
  • *
  • Posts: 2
How to programming for selection the network adapter.
« on: September 13, 2013, 12:56:47 AM »
As you know,We found the problem of Used for multiple ethernet cards(NICs), I try to fix it with setting the ENetAddress variable thus as bewlow.

ENetAddress *pSourceAddress;   /* Used for multiple ethernet cards.  This address is the address of the card to use. */

But it dose not work, So, I have see the "Adapter" menu selection in NetEdit3.
Could you give me the code which define the enthernet adapter like in NetEdit3 function or another solution to fix my problem.

Thank you,


  • Newbie
  • *
  • Posts: 2
Re: How to programming for selection the network adapter.
« Reply #1 on: September 13, 2013, 08:54:34 AM »
For my question above,I can fix it already.
So,I'l like to shear my solution with you.
Normally , If you write the C++ code for connect multiple Ethernet card(NICs).
You must define any value of Ethernet adapter which your controller connection.
In C++ programming,You can follow with my code thus as below .
/**  Step 2, initialize the transport    */
TP.Transport = HEIT_WINSOCK;
TP.Protocol = Protocol;

//Define ENetAddress before call HEIOpenTransport ,
You must define all parameter of ENetAddress type if it isn't completely then your code will not able connect it

ENetAddress SourceAddress;

//Define IP Address of Adapter which you want to connect.
/***  Ex.IP Address is

for(int xx=0;xx<8;xx++)

//Open transport with your adapter selection.   
HEIOpenTransport(&TP, HEIAPIVERSION, &SourceAddress);

« Last Edit: September 13, 2013, 09:36:24 AM by narongy »


  • Host Moderator
  • Hero Member
  • *****
  • Posts: 5793
  • Yes Pinky, Do-more will control the world!
Re: How to programming for selection the network adapter.
« Reply #2 on: September 13, 2013, 03:41:20 PM »
As you have already concluded, you have to preload the adapter's primary IP address into the structure. When the library opens the socket, it binds to the specified address.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO