Attached is the object from my Winsock example. After you download, take the .txt off the end of the file and import it into your app.
The following code should do it:
n_winsock ln_ws
String ls_hostname, ls_ipaddress
ls_hostname = ln_ws.of_GetHostName()
ls_ipaddress = ln_ws.of_GetIPAddress(ls_hostname)