I have two internet cards on my machine configured with two separate ip addresses. Both ip addresses are part of the same network. Am I right in saying that when I create a socket that it is specific for one of these ip addresses?
UPDATE:
Here's my situation:
I have a hardware device located at 192.168.0.10. It communicates via udp to (192.168.0.11, 50000) and (192.168.0.12, 50000). The hardware device does this via two ports, as follows: (192.168.0.10, 49000) and (192.168.0.10, 49001).
I create the ports (192.168.0.11, 50000) and (192.168.0.12, 50000) via a script so that I can log and manipulate the communication, the data is then forwarded to two simulators which are capable of talking with the hardware.
So in effect, my script is "the man in the middle" where I log and corrupt data for the purpose of testing the hardware.
Here are the socket interfaces for my script:
IP 1 - Channel 1
External_socket = (192.168.0.10, 49000) ** Hardware
External_side_socket = (192.168.0.11, 50000) ** Script
Simulator_side_socket = (192.168.0.11, 50001) ** Script
Simulator_socket = (192.168.0.11, 50002) ** Simulator
IP2 - Channel 2
External_socket = (192.168.0.10, 49001) ** Hardware
External_side_socket = (192.168.0.12, 50000) ** Script
Simulator_side_socket = (192.168.0.12, 50001) ** Script
Simulator_socket = (192.168.0.12, 60002) ** Simulator
And this works as expected, and the correct data is logged for each channel.
However, it stops working if I make two simple changes:
1) I change the second simulator's configuration file to 50002 from 60002, while keeping the ip address at 192.168.0.12.
2) In my script I also change 60002 to 50002, for IP2.
Suddenly the data from the second channel is arriving at the first simulator. How can this be? .net has an IPAny and I'm wondering if the simulator is using this somehow and ignoring the ip address in its config file. Do you think that might be the issue here?
Thanks,
Barry