; HostIP Example ; -------------- ; HostIP reads the results of the most recent CountHostIPs ; lookup, so that call always comes first - "localhost" ; resolves even with no internet connection. count=CountHostIPs("localhost") Print "CountHostIPs('localhost') found "+count+" address(es)" ; Indexes run from 1 to the count returned by CountHostIPs For i=1 To count ip=HostIP(i) ; HostIP returns the address as a packed integer - ; DottedIP turns it into the familiar dotted form Print "HostIP("+i+") = "+ip+" -> "+DottedIP$(ip) Next If count>0 Then Print "" Print "A game would now connect to "+DottedIP$(HostIP(1)) Print "(OpenTCPStream and SendUDPMsg both accept these values)" EndIf Print "" Print "Press any key to close the example" WaitKey End