Contents Up Previous Next

wxIPV4address

Derived from

wxSockAddress

Include files

<wx/socket.h>

Members

wxIPV4address::Hostname
wxIPV4address::Hostname
wxIPV4address::Service
wxIPV4address::Service
wxIPV4address::Service
wxIPV4address::AnyAddress
wxIPV4address::LocalHost


wxIPV4address::Hostname

bool Hostname(const wxString& hostname)

Set the address to hostname, which can be a host name or an IP-style address in dot notation (a.b.c.d)

Return value

Returns TRUE on success, FALSE if something goes wrong (invalid hostname or invalid IP address).


wxIPV4address::Hostname

wxString Hostname()

Returns the hostname which matches the IP address.


wxIPV4address::Service

bool Service(const wxString& service)

Set the port to that corresponding to the specified service.

Return value

Returns TRUE on success, FALSE if something goes wrong (invalid service).


wxIPV4address::Service

bool Service(unsigned short service)

Set the port to that corresponding to the specified service.

Return value

Returns TRUE on success, FALSE if something goes wrong (invalid service).


wxIPV4address::Service

unsigned short Service()

Returns the current service.


wxIPV4address::AnyAddress

bool AnyAddress()

Set address to any of the addresses of the current machine. Whenever possible, use this function instead of wxIPV4address::LocalHost, as this correctly handles multi-homed hosts and avoids other small problems. Internally, this is the same as setting the IP address to INADDR_ANY.

Return value

Returns TRUE on success, FALSE if something went wrong.


wxIPV4address::LocalHost

bool LocalHost()

Set address to localhost (127.0.0.1). Whenever possible, use the wxIPV4address::AnyAddress, function instead of this one, as this will correctly handle multi-homed hosts and avoid other small problems.

Return value

Returns TRUE on success, FALSE if something went wrong.