Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

gResolverLookupByName

gResolverLookupByName


Description

Synchronously resolves hostname to determine its associated IP address(es). hostname may be an ASCII-only or UTF-8 hostname, or the textual form of an IP address (in which case this just becomes a wrapper around gInetAddressNewFromString).

Usage

gResolverLookupByName(object, hostname, cancellable = NULL, .errwarn = TRUE)

Arguments

object

a GResolver

hostname

the hostname to look up

cancellable

a GCancellable, or NULL

.errwarn

Whether to issue a warning on error or fail silently

Details

On success, gResolverLookupByName will return a list of GInetAddress, sorted in order of preference. (That is, you should attempt to connect to the first address first, then the second if the first fails, etc.)

If the DNS resolution fails, error (if non-NULL) will be set to a value from GResolverError.

If cancellable is non-NULL, it can be used to cancel the operation, in which case error (if non-NULL) will be set to G_IO_ERROR_CANCELLED.

If you are planning to connect to a socket on the resolved IP address, it may be easier to create a GNetworkAddress and use its GSocketConnectable interface. Since 2.22

Value

A list containing the following elements:

retval

[list] a list of GInetAddress, or NULL on error. You must unref each of the addresses and free the list when you are done with it. (You can use gResolverFreeAddresses to do this.)

error

return location for a GError, or NULL

Author(s)

Derived by RGtkGen from GTK+ documentation


RGtk2

R Bindings for Gtk 2.8.0 and Above

v2.20.36
GPL
Authors
Michael Lawrence <michafla@gene.com> and Duncan Temple Lang <duncan@wald.ucdavis.edu>
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.