Alaska Software Inc. - Different behaviour SocketGetHostByAddr under WindowsXP
Username: Password:
AuthorTopic: Different behaviour SocketGetHostByAddr under WindowsXP
Robert SachmannDifferent behaviour SocketGetHostByAddr under WindowsXP
on Wed, 19 Apr 2006 15:53:46 +0200
Hello,

if you want to get the hostname of a localhost - Client (connected with IP
127.0.0.1 to a Server) using the function SocketGetHostByAddr with an
Windows2000-PC the function returns the computername of the client-pc

The same function under WindowsXp returns "localhost" instead of the
computername

   aInetAdr  := SocketGetPeerName( nClientSocket )
   cIPAddr   := SocketInetNtoA ( aInetAdr[IPADDR_ADDR ] )
   aHostInfo := SocketGetHostByAddr( cIPAddr  )

   cHostName := aHostInfo[HOSTINFO_CNAME]  cHostName:= "MYPCNAME" under
Win2000
   cHostName := aHostInfo[HOSTINFO_CNAME]  cHostName:= "localhost"under
WinXP

Is there a way to avoid that?