I verified this works fine to connect a single process client through 2 different NICs to the same server. The server process accepted two connections. One from 192.168.1.7 and the other from 192.168.1.102. Here is most of the code for the client. I can give you server code as well but it's not important for this example. Your server setup window in altbinz would need to have 3 fields: address, port, and optional local ip. If you look at freeproxy, you can see they have a drop-down list of network cards instead of local bind address - this just makes it easier for the user but is not required.
const char *serverAddressStr = "your news server url or ip";
int nPort = 119; //server port
const char *localNicAddressStr[2] = { "192.168.1.7", "192.168.1.102" }; //addresses assigned to each of your network cards.
u_long serverAddress = inet_addr(serverAddressStr);
if (serverAddress == INADDR_NONE)
{
// serverAddressStr isn't a dotted IP, so resolve it through DNS
hostent* pHE = gethostbyname(serverAddressStr);
if (pHE == 0)
return INADDR_NONE;
serverAddress = *((u_long*)pHE->h_addr_list[0]);
}
SOCKET sd[2];
//connect each network card to the server
for (int i = 0; i < 2; ++i)
{
sd[i] = socket(AF_INET, SOCK_STREAM, 0);
if (sd[i] != INVALID_SOCKET) {
sockaddr_in sinRemote;
sinRemote.sin_family = AF_INET;
sinRemote.sin_addr.s_addr = serverAddress;
sinRemote.sin_port = htons(nPort);
sockaddr_in sinInterface;
u_long nLocalAddr = inet_addr(localNicAddressStr[i]);
sinInterface.sin_family = AF_INET;
sinInterface.sin_addr.s_addr = nLocalAddr;
sinInterface.sin_port = 0; //assign automatic port
if (bind(sd[i], (sockaddr*)&sinInterface, sizeof(sockaddr_in)) != SOCKET_ERROR)
{
if (connect(sd[i], (sockaddr*)&sinRemote, sizeof(sockaddr_in)) == SOCKET_ERROR)
sd[i] = INVALID_SOCKET;
}
}
}
//send and receive message from each network card
const char* EchoMessage = "Echo Message";
const int EchoMessageLen = strlen(EchoMessage);
for (int i = 0; i < 2; ++i)
{
if (send(sd[i], EchoMessage, EchoMessageLen, 0) != SOCKET_ERROR)
{
//get reply from server
char ReadBuffer[128];
int TotalBytes = 0;
while (TotalBytes < EchoMessageLen)
{
int NewBytes = recv(sd[i], ReadBuffer + TotalBytes, 128 - TotalBytes, 0);
TotalBytes += NewBytes;
}
}
}