NISystemsEngineering / AsynchronousMessageCommunication

The Asynchronous Message Communication (AMC) Reference Library is a general purpose LabVIEW API for sending messages within a process, between processes, and between different LabVIEW targets (systems on a network) in a LabVIEW application.
https://decibel.ni.com/content/docs/DOC-10294
Other
8 stars 5 forks source link

Improve fix #6 for computers with multiple network ports #10

Closed smithedl closed 8 years ago

smithedl commented 8 years ago

Ignore previous report, I was mistaken. Actual issue is that #6 has been built, but its causing issues on my system with no DNS and multiple IP addresses. Specifically, lets say this: -I have a 10.1.1.x address which is the corporate network -I have a 192.168.1.y address which is the local network If I send a message to 192.168.1.100, AMC should send the source IP as being 192.168.1.y. If I send a message to 10.1.1.100, it should say the source is 10.1.1.x. Unfortunately right now it uses the lv primitives which means it sends the default, so while I am perfectly capable of sending a message to 192.168.1.100, it can't respond because its trying to send a message to 10.1.1.x

smithedl commented 8 years ago

updated issue with a different description, my original understanding of the issue I was having was wrong.

smithedl commented 8 years ago

snippet I think this fixes the issue. It basically gets all the IP addresses (multi-output on str to ip) then ands them with the desired IP. The largest one is the best match (for example if only the first two numbers match its 255.255.0.0 while if all three match its 255.255.255.0