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

GSocketConnectable

GSocketConnectable


Description

Interface for potential socket endpoints

Methods and Functions

gSocketConnectableEnumerate(object)
gSocketAddressEnumeratorNext(object, cancellable = NULL, .errwarn = TRUE)
gSocketAddressEnumeratorNextAsync(object, cancellable = NULL, callback, user.data = NULL)
gSocketAddressEnumeratorNextFinish(object, result, .errwarn = TRUE)

Hierarchy

GInterface
   +----GSocketConnectable
GObject
   +----GSocketAddressEnumerator

Implementations

GSocketConnectable is implemented by GInetSocketAddress, GNetworkAddress, GNetworkService, GSocketAddress and GUnixSocketAddress.

Detailed Description

Objects that describe one or more potential socket endpoints implement GSocketConnectable. Callers can then use gSocketConnectableEnumerate to get a GSocketAddressEnumerator to try out each socket address in turn until one succeeds, as shown in the sample code below.

connect_to_host <- function(hostname, port, cancellable)
{
  addr <- gNetworkAddress(hostname, port)
  enumerator <- addr$enumerate()
  
  ## Try each sockaddr until we succeed. 

  conn <- NULL
  while (is.null(conn) && (!is.null(sockaddr <- enumerator$next(cancellable))))
    conn <- connect_to_sockaddr(sockaddr$retval)
  
  conn
}

Structures

GSocketConnectable

Interface for objects that contain or generate GSocketAddresses.

GSocketAddressEnumerator

Enumerator type for objects that contain or generate GSocketAddresses.

Author(s)

Derived by RGtkGen from GTK+ documentation

References


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.