wxRuby Documentation Home

# Wx::IPV4address

## Derived from

IPaddress

## Methods

- IPV4address#hostname
- IPV4address#ip_address
- IPV4address#service
- IPV4address#any_address
- IPV4address#local_host

### IPV4address#hostname

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

String hostname()

Returns the hostname which matches the IP address.

### IPV4address#ip_address

String ip_address()

Returns a String containing the IP address in dot quad (127.0.0.1) format.

### IPV4address#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.

### IPV4address#any_address

Boolean any_address()

Set address to any of the addresses of the current machine. Whenever
possible, use this function instead of IPV4address#local_host,
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.

### IPV4address#local_host

Boolean local_host()

Set address to localhost (127.0.0.1). Whenever possible, use the
IPV4address#any_address,
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.

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