; DottedIP Example ; ---------------- ; Blitz3D+ handles IP addresses as packed integers: one byte per ; part, highest byte first. DottedIP formats them for humans. ; Build 192.168.1.42 by packing its four parts into one integer ip=(192 Shl 24) Or (168 Shl 16) Or (1 Shl 8) Or 42 Print "Packed integer "+ip+" is "+DottedIP$(ip) ; The loopback address 127.0.0.1 packs down to 2130706433 loopback=(127 Shl 24) Or 1 Print "Packed integer "+loopback+" is "+DottedIP$(loopback) ; Every networking command that returns an address returns these ; integers - HostIP, RecvUDPMsg, UDPMsgIP, TCPStreamIP... count=CountHostIPs("localhost") If count>0 Then Print "HostIP for 'localhost' = "+HostIP(1)+" -> "+DottedIP$(HostIP(1)) EndIf Print "" Print "Press any key to close the example" WaitKey End