dsfml.network.ipaddress



class IPAddress;
IPAddress provides easy manipulation of IP v4 addresses

this(char[] address);
Construct the address from a string

Params:
char[] address IP address ("xxx.xxx.xxx.xxx") or network name

this(ubyte byte0, ubyte byte1, ubyte byte2, ubyte byte3);
Construct the address from 4 bytes

Params:
ubyte byte0 First byte of the address
ubyte byte1 Second byte of the address
ubyte byte2 Third byte of the address
ubyte byte3 Fourth byte of the address

bool isValid();
Tell if the address is a valid one

Returns:
True if address has a valid syntax



char[] toString();
Get a string representation of the address

Returns:
String representation of the IP address ("xxx.xxx.xxx.xxx")



static IPAddress getLocalAddress();
Get the computer's local IP address (from the LAN point of view)

Returns:
Local IP address



static IPAddress getPublicAddress();
Get the computer's public IP address (from the web point of view). The only way to get a public address is to ask it to a distant website ; as a consequence, this function may be very slow -- use it as few as possible !

Returns:
Public IP address



static IPAddress LOCALHOST();
Local host address (to connect to the same computer).


Page generated by Ddoc.