Internet, Returning Host name from WinShock


‘Description: Asynchronous routine which returns the true host name given
‘             an IP address, or Web address.

‘Usage
‘Handle = WSAAsyncGetHostByNameAlias(Text1.hWnd, &H202, “www.intrstar.net”)

‘Public Function WSAAsyncGetHostByNameAlias(hWnd As Integer, wMsg As Integer, Host As String) As Long
Dim retIP As Long
retIP = inet_addr(Host)
If retIP = INADDR_NONE Then
retIP = WSAAsyncGetHostByName(hWnd, wMsg, Host, hostentbuffer, hostentasync_size)
Else
retIP = WSAAsyncGetHostByAddr(hWnd, wMsg, retIP, 4, AF_INET, hostentbuffer, hostentasync_size)
End If
WSAAsyncGetHostByNameAlias = retIP
‘End Function

One response to “Internet, Returning Host name from WinShock

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s