Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: SocketAddressEnumerator

[23:7] extends: object

GSocketAddressEnumerator is an enumerator type for [class@Gio.SocketAddress] instances. It is returned by enumeration functions such as [method@Gio.SocketConnectable.enumerate], which returns a GSocketAddressEnumerator to list each [class@Gio.SocketAddress] which could be used to connect to that [iface@Gio.SocketConnectable]. Enumeration is typically a blocking operation, so the asynchronous methods [method@Gio.SocketAddressEnumerator.next_async] and [method@Gio.SocketAddressEnumerator.next_finish] should be used where possible. Each GSocketAddressEnumerator can only be enumerated once. Once [method@Gio.SocketAddressEnumerator.next] has returned NULL, further enumeration with that GSocketAddressEnumerator is not possible, and it can be unreffed.

Members

  • handleObj
  • lib
  • retainedCallbacks
  • signalHandlerNames
  • signalSetterHandlers

Methods

  • SocketAddressEnumerator (Handle = null)

    Creates a new SocketAddressEnumerator by wrapping a native handle or another wrapper.

    • @p Handle is the native handle or another wrapper whose handle to adopt.
  • toNativeHandle (Source)

    Normalizes a constructor argument into a raw pointer carrier. Accepts a raw NativeHandle, a raw NativeBuffer returned from fn.call(...), another generated wrapper exposing handle(), or null. Returns null when the argument carries no pointer.

    • @p Source is the raw handle, raw buffer, wrapper, or null.
    • @r A raw pointer carrier or null when no pointer is present.
  • getLib ()

    Returns the opened native library for this generated wrapper.

    • @r The opened native library.
  • handle ()

    Returns the wrapped NativeHandle.

    • @r The wrapped NativeHandle.
  • isNull ()

    Returns true when the wrapped handle is null.

    • @r A bool.
  • describe ()

    Returns a small string for debugging generated wrappers.

    • @r A string.
  • asObject ()

    Wraps this handle as Object.

    • @r A Object object.
  • next (object cancellable)

    Retrieves the next #GSocketAddress from @enumerator. Note that this may block for some amount of time. (Eg, a #GNetworkAddress may need to do a DNS lookup before it can return an address.) Use g_socket_address_enumerator_next_async() if you need to avoid blocking. If @enumerator is expected to yield addresses, but for some reason is unable to (eg, because of a DNS error), then the first call to g_socket_address_enumerator_next() will return an appropriate error in *error. However, if the first call to g_socket_address_enumerator_next() succeeds, then any further internal errors (other than @cancellable being triggered) will be ignored.

    • @p cancellable is optional #GCancellable object, %NULL to ignore..
  • next_finish (object result)

    Retrieves the result of a completed call to g_socket_address_enumerator_next_async(). See g_socket_address_enumerator_next() for more information about error handling.

    • @p result is a #GAsyncResult.