New network function
Posted: Thu Jul 11, 2013 1:51 pm
In PB lacks some network functions.
Such as:
Function IPAddressType() should determine the type of IP addresses, returning one of the following values.
Function IPToBin() should return the IP address in binary form. For IPv4, this is a variable of type Long, and for IPv6, it is a pointer to a structure containing the 16 byte static array (similar functions GetClientIP() and NextIPAddress()).
Function IPToHostName() must convert IP address into a domain name. Argument Type, specifies the type of IP address (IPv4 or IPv6).
Function HostNameToIP() must convert the domain name into an IP address. Argument Type, specifies the type of IP address (IPv4 or IPv6).
And it would be great if the added support for non-blocking sockets. http://www.purebasic.fr/english/viewtop ... 24#p402824
Such as:
Code: Select all
IPAddressType(IP.s) ; Type IP (IPv4 or IPv6).
IPToBin(IP.s) ; Convert IP-string (IPv4 or IPv6) in binary form (IPv4 - 4 bytes; IPv6 - 16 bytes).
IPToHostName(IP.s, Type) ; Convert IP-string (IPv4 or IPv6) in the domain name (for example 127.0.0.1 converted to localhost).
HostNameToIP(IP.s, Type) ; Convert a domain name in IP-string (IPv4 or IPv6) (for example localhost converted to 127.0.0.1).
Code: Select all
#PB_Network_IPv4
#PB_Network_IPv6
#PB_Error ; The address contains illegal characters or the address is incorrect.
Function IPToHostName() must convert IP address into a domain name. Argument Type, specifies the type of IP address (IPv4 or IPv6).
Function HostNameToIP() must convert the domain name into an IP address. Argument Type, specifies the type of IP address (IPv4 or IPv6).
And it would be great if the added support for non-blocking sockets. http://www.purebasic.fr/english/viewtop ... 24#p402824