wxRuby Documentation Home

Wx::IPaddress

IPaddress is an abstract base class for all internet protocol address
objects. Currently, only IPV4address
is implemented. An experimental implementation for IPV6, IPV6address,
is being developed.

Derived from

SockAddress

Methods

IPaddress#hostname

Boolean hostname(%(arg-type)String% 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).

String hostname()

Returns the hostname which matches the IP address.

IPaddress#ip_address

String ip_address()

Returns a String containing the IP address.

IPaddress#service

Boolean service(%(arg-type)String% service)

Set the port to that corresponding to the specified service.

Return value

Returns true on success, false if something goes wrong
(invalid service).

Boolean service(%(arg-type)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).

unsigned short service()

Returns the current service.

IPaddress#any_address

Boolean any_address()

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.

IPaddress#local_host

Boolean local_host()

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.

IPaddress#is_local_host

Boolean is_local_host()

Determines if current address is set to localhost.

Return value

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

[This page automatically generated from the Textile source at 2023-06-09 00:45:32 +0000]