wxIPaddress

wxIPaddress is an abstract base class for all internet protocol address objects. Currently, only wxIPV4address is implemented. An experimental implementation for IPV6, wxIPV6address, is being developed.

Derived from

wxSockAddress

Include files

<wx/socket.h>



wxIPaddress::Hostname



virtual bool Hostname(const wxString& hostname)

Set the address to hostname, which can be a host name or an IP-style address in a format dependent on implementation.

Return value

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



virtual wxString Hostname(void)

Returns the hostname which matches the IP address.



wxIPaddress::IPAddress



virtual wxString IPAddress(void)

Returns a wxString containing the IP address.



wxIPaddress::Service



virtual 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).



virtual 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).



virtual unsigned short Service(void)

Returns the current service.



wxIPaddress::AnyAddress



virtual bool AnyAddress(void)

Internally, this is the same as setting the IP address to INADDR_ANY.

On IPV4 implementations, 0.0.0.0

On IPV6 implementations, ::

Return value

Returns true on success, false if something went wrong.



wxIPaddress::LocalHost



virtual bool LocalHost(void)

Set address to localhost.

On IPV4 implementations, 127.0.0.1

On IPV6 implementations, ::1

Return value

Returns true on success, false if something went wrong.



wxIPaddress::IsLocalHost



virtual bool IsLocalHost(void)

Determines if current address is set to localhost.

Return value

Returns true if address is localhost, false if internet address.

ymasuda 平成17年11月19日