:right-sidebar: True SocketAddressEnumerator =================================================================== .. currentmodule:: gi.repository.Gio .. class:: SocketAddressEnumerator(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.GObject.Object` Subclasses: :class:`~gi.repository.Gio.ProxyAddressEnumerator` :Constructors: :: SocketAddressEnumerator(**properties) Methods ------- .. rst-class:: interim-class .. class:: SocketAddressEnumerator :no-index: .. method:: next(cancellable: ~gi.repository.Gio.Cancellable | None = None) -> ~gi.repository.Gio.SocketAddress | None Retrieves the next :obj:`~gi.repository.Gio.SocketAddress` from ``enumerator``. Note that this may block for some amount of time. (Eg, a :obj:`~gi.repository.Gio.NetworkAddress` may need to do a DNS lookup before it can return an address.) Use :func:`~gi.repository.Gio.SocketAddressEnumerator.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 :func:`~gi.repository.Gio.SocketAddressEnumerator.next` will return an appropriate error in *``error``. However, if the first call to :func:`~gi.repository.Gio.SocketAddressEnumerator.next` succeeds, then any further internal errors (other than ``cancellable`` being triggered) will be ignored. :param cancellable: optional :obj:`~gi.repository.Gio.Cancellable` object, :const:`None` to ignore. .. method:: next_async(cancellable: ~gi.repository.Gio.Cancellable | None = None, callback: ~typing.Callable[[...], None] | None = None, *user_data: ~typing.Any) -> None Asynchronously retrieves the next :obj:`~gi.repository.Gio.SocketAddress` from ``enumerator`` and then calls ``callback``, which must call :func:`~gi.repository.Gio.SocketAddressEnumerator.next_finish` to get the result. It is an error to call this multiple times before the previous callback has finished. :param cancellable: optional :obj:`~gi.repository.Gio.Cancellable` object, :const:`None` to ignore. :param callback: a :obj:`~gi.repository.Gio.AsyncReadyCallback` to call when the request is satisfied :param user_data: the data to pass to callback function .. method:: next_finish(result: ~gi.repository.Gio.AsyncResult) -> ~gi.repository.Gio.SocketAddress | None Retrieves the result of a completed call to :func:`~gi.repository.Gio.SocketAddressEnumerator.next_async`. See :func:`~gi.repository.Gio.SocketAddressEnumerator.next` for more information about error handling. :param result: a :obj:`~gi.repository.Gio.AsyncResult` Virtual Methods --------------- .. rst-class:: interim-class .. class:: SocketAddressEnumerator :no-index: .. method:: do_next(cancellable: ~gi.repository.Gio.Cancellable | None = None) -> ~gi.repository.Gio.SocketAddress | None Retrieves the next :obj:`~gi.repository.Gio.SocketAddress` from ``enumerator``. Note that this may block for some amount of time. (Eg, a :obj:`~gi.repository.Gio.NetworkAddress` may need to do a DNS lookup before it can return an address.) Use :func:`~gi.repository.Gio.SocketAddressEnumerator.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 :func:`~gi.repository.Gio.SocketAddressEnumerator.next` will return an appropriate error in *``error``. However, if the first call to :func:`~gi.repository.Gio.SocketAddressEnumerator.next` succeeds, then any further internal errors (other than ``cancellable`` being triggered) will be ignored. :param cancellable: optional :obj:`~gi.repository.Gio.Cancellable` object, :const:`None` to ignore. .. method:: do_next_async(cancellable: ~gi.repository.Gio.Cancellable | None = None, callback: ~typing.Callable[[...], None] | None = None, *user_data: ~typing.Any) -> None Asynchronously retrieves the next :obj:`~gi.repository.Gio.SocketAddress` from ``enumerator`` and then calls ``callback``, which must call :func:`~gi.repository.Gio.SocketAddressEnumerator.next_finish` to get the result. It is an error to call this multiple times before the previous callback has finished. :param cancellable: optional :obj:`~gi.repository.Gio.Cancellable` object, :const:`None` to ignore. :param callback: a :obj:`~gi.repository.Gio.AsyncReadyCallback` to call when the request is satisfied :param user_data: the data to pass to callback function .. method:: do_next_finish(result: ~gi.repository.Gio.AsyncResult) -> ~gi.repository.Gio.SocketAddress | None Retrieves the result of a completed call to :func:`~gi.repository.Gio.SocketAddressEnumerator.next_async`. See :func:`~gi.repository.Gio.SocketAddressEnumerator.next` for more information about error handling. :param result: a :obj:`~gi.repository.Gio.AsyncResult` Fields ------ .. rst-class:: interim-class .. class:: SocketAddressEnumerator :no-index: .. attribute:: parent_instance