I am looking for a way that can set which Network device my script will use.
In essence I have a TCP peripheral device with its own Network Connection via USB (let's call it Local Area Connection 2), the peripheral device acts as a DHCP server giving an IP address assigned of 192.168.11.2
At the same time the device also responds to UDP connections on a separate address of 12.0.0.1.
There are no issues creating a connection to the device for TCP communications, however when I attempt communications via UDP the connection attempt is invariably routed to my prime Local Area Connection device rather than the peripheral.
Disabling the prime Local Area Connection will allow the UDP traffic onto Local Area Connection 2 - and the device will respond, but only as long as it is the only active connection.
Ok - so we could assign an IP address to the device (same as the original DHCP assigned address), and add a second address in the 12.0.0.x range. This will bind the adaptor to the required range however it does not make the script fully transportable.
Is there a way to control which network device my script will use? without having to force IP address ranges.
Currently I am using a socket client class for the 192... address TCP traffic, and a simple fsockopen arrangement for the UDP traffic.
Operating system is windows (XP).
This has had me stumped for some time now and I would greatly appreciate some assistance.