Jump to content

specify network adapter to use for _TCPIpToName?


Recommended Posts

is there a way to specify what network adapter to use for _TCPIpToName?

if not, is there a way to modify it to?

my problem is that its using the wrong adapter & thus not getting the right result

i have three network adapters, LAN & two VMware virtual ones

when i run this (.5 is a computer i know is on & connected fine, i can ping it & have verified its ip & connection on it)

#include <Inet.au3>
Opt("TrayIconDebug",1)
$ip="192.168.0.5"
Dim $ipname
TCPStartup()
$ipname=_TCPIpToName($ip,1)
For $i=1 To $ipname[0]
    MsgBox(0,"dev "&@error,"ip's "&$ipname[0]&@CR&$ipname[$i])
Next
TCPShutdown()

i tried using the array to see if it brings back multiple, but it brings back neontorrents.org when that computer is on.

when i disable both the VMware adapters it runs fine, but takes 6-14 extra secs to complete, sticking on trying to use the disabled adapter i guess.

i know nothing of interacting with dll's in autoit, let alone if this is possible.

now i know asking people todo stuff for me is lame, but this is out of my league. :P

Edited by AquilaChill
people are anoying, am i? ;) v2.95
Link to comment
Share on other sites

Looks like this was discused when it was first implmented- http://www.autoitscript.com/forum/index.php?showtopic=36173

As metioned in the port, there is no way to know for sure a 1 to 1 corelation between a name and ip address. The remarks in the documentation for the function used in the UDF (http://msdn2.microsoft.com/en-us/library/ms738521.aspx) metion that - 1. It's depreciated now (use getnameinfo instead) and 2-

The capability to perform reverse lookups using the gethostbyaddr function is convenient, but such lookups are considered inherently unreliable, and should be used only as a hint.

Just like PaulIA said in the post.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...