I don't think that there is any good documented way to override the routing
table with selecting which physical interface to send on with the default
Microsoft sockets provider in use. SO_DONTROUTE is, as far as I know,
ignored for Microsoft providers.
I think that the DHCP client service (in dhcpsvc.dll) used some undocumented
setsockopt and WSAIoctl calls to turn off routing for a UDP socket, but I'm
not sure if these are still used for modern OS's. You might try
disassembling a bit of dhcpsvc to find out.
--
Ken Johnson (Skywing)
Windows SDK MVP
http://www.nynaeve.net
"Smedly Tonker" <(E-Mail Removed)> wrote in message
news:u52ci8S%(E-Mail Removed)...
> Is there any network Gurus out there that can answer the below question?
>
>
>
> Question:
>
> How in software can I specify that socket traffic only be sent using a
> certain IP? Remember that binding to an address only grantees which IP the
> traffic can come from and not how it is sent. From my description of the
> problem below, it is not possible to mess with the route table as either
> one instance of my server software will work and the other will fail. What
> is needed is a way to grantee delivery using a certain IP at the socket
> level.
>
>
>
> Description of problem:
>
> I need to be able to run two instances of my server software on a server
> (Windows Server 2003). I have two NICs within the server and should be
> able to bind a listen socket on the same port for each IP address. I will
> bind each listen socket to one of the two IP address. This will grantee
> that incoming traffic will only be received by the designated NIC. It will
> not however grantee which IP/NIC is used to send a UDP message. Messages
> must be sent from the correct IP address or the corresponding ACKs will be
> received by the wrong server instance. If each NIC has the same route
> metric than it is a dice game on which will be used to send my UDP
> traffic.
>
>