Description Methods and Functions Hierarchy Implementations Detailed Description Structures Author(s) References
Interface for potential socket endpoints
gSocketConnectableEnumerate(object)
gSocketAddressEnumeratorNext(object, cancellable = NULL, .errwarn = TRUE)
gSocketAddressEnumeratorNextAsync(object, cancellable = NULL, callback, user.data = NULL)
gSocketAddressEnumeratorNextFinish(object, result, .errwarn = TRUE)
1 2 3 4 | GInterface
+----GSocketConnectable
GObject
+----GSocketAddressEnumerator
|
GSocketConnectable is implemented by
GInetSocketAddress
, GNetworkAddress
, GNetworkService
, GSocketAddress
and GUnixSocketAddress.
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.
1 2 3 4 5 6 7 8 9 10 11 12 13 | 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
}
|
GSocketConnectable
Interface for objects that contain or generate GSocketAddress
es.
GSocketAddressEnumerator
Enumerator type for objects that contain or generate
GSocketAddress
es.
Derived by RGtkGen from GTK+ documentation
https://developer.gnome.org/gio/stable/GSocketConnectable.html
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.