Gio.SocketAddressEnumerator¶
| Subclasses: | Gio.ProxyAddressEnumerator |
|---|
Methods¶
| Inherited: | GObject.Object (37) |
|---|---|
| Structs: | GObject.ObjectClass (5) |
next (cancellable) |
|
next_async (cancellable, callback, *user_data) |
|
next_finish (result) |
Virtual Methods¶
| Inherited: | GObject.Object (7) |
|---|
do_next (cancellable) |
|
do_next_async (cancellable, callback, *user_data) |
|
do_next_finish (result) |
Properties¶
None
Signals¶
| Inherited: | GObject.Object (1) |
|---|
Class Details¶
-
class
Gio.SocketAddressEnumerator(**kwargs)¶ Bases: GObject.ObjectAbstract: Yes Structure: Gio.SocketAddressEnumeratorClassGio.SocketAddressEnumeratoris an enumerator type forGio.SocketAddressinstances. It is returned by enumeration functions such asGio.SocketConnectable.enumerate(), which returns aGio.SocketAddressEnumeratorto list eachGio.SocketAddresswhich could be used to connect to thatGio.SocketConnectable.Enumeration is typically a blocking operation, so the asynchronous methods
Gio.SocketAddressEnumerator.next_async() andGio.SocketAddressEnumerator.next_finish() should be used where possible.Each
Gio.SocketAddressEnumeratorcan only be enumerated once. OnceGio.SocketAddressEnumerator.next() has returnedNone, further enumeration with thatGio.SocketAddressEnumeratoris not possible, and it can be unreffed.-
next(cancellable)[source]¶ Parameters: cancellable ( Gio.CancellableorNone) – optionalGio.Cancellableobject,Noneto ignore.Raises: GLib.ErrorReturns: a Gio.SocketAddress(owned by the caller), orNoneon error (in which case error will be set) or if there are no more addresses.Return type: Gio.SocketAddressRetrieves the next
Gio.SocketAddressfrom self. Note that this may block for some amount of time. (Eg, aGio.NetworkAddressmay need to do a DNS lookup before it can return an address.) UseGio.SocketAddressEnumerator.next_async() if you need to avoid blocking.If self is expected to yield addresses, but for some reason is unable to (eg, because of a DNS error), then the first call to
Gio.SocketAddressEnumerator.next() will return an appropriate error in error. However, if the first call toGio.SocketAddressEnumerator.next() succeeds, then any further internal errors (other than cancellable being triggered) will be ignored.
-
next_async(cancellable, callback, *user_data)[source]¶ Parameters: - cancellable (
Gio.CancellableorNone) – optionalGio.Cancellableobject,Noneto ignore. - callback (
Gio.AsyncReadyCallbackorNone) – aGio.AsyncReadyCallbackto call when the request is satisfied - user_data (
objectorNone) – the data to pass to callback function
Asynchronously retrieves the next
Gio.SocketAddressfrom self and then calls callback, which must callGio.SocketAddressEnumerator.next_finish() to get the result.It is an error to call this multiple times before the previous callback has finished.
- cancellable (
-
next_finish(result)[source]¶ Parameters: result ( Gio.AsyncResult) – aGio.AsyncResultRaises: GLib.ErrorReturns: a Gio.SocketAddress(owned by the caller), orNoneon error (in which case error will be set) or if there are no more addresses.Return type: Gio.SocketAddressRetrieves the result of a completed call to
Gio.SocketAddressEnumerator.next_async(). SeeGio.SocketAddressEnumerator.next() for more information about error handling.
-
do_next(cancellable) virtual¶ Parameters: cancellable ( Gio.CancellableorNone) – optionalGio.Cancellableobject,Noneto ignore.Returns: a Gio.SocketAddress(owned by the caller), orNoneon error (in which case error will be set) or if there are no more addresses.Return type: Gio.SocketAddressRetrieves the next
Gio.SocketAddressfrom enumerator. Note that this may block for some amount of time. (Eg, aGio.NetworkAddressmay need to do a DNS lookup before it can return an address.) UseGio.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
Gio.SocketAddressEnumerator.next() will return an appropriate error in error. However, if the first call toGio.SocketAddressEnumerator.next() succeeds, then any further internal errors (other than cancellable being triggered) will be ignored.
-
do_next_async(cancellable, callback, *user_data) virtual¶ Parameters: - cancellable (
Gio.CancellableorNone) – optionalGio.Cancellableobject,Noneto ignore. - callback (
Gio.AsyncReadyCallbackorNone) – aGio.AsyncReadyCallbackto call when the request is satisfied - user_data (
objectorNone) – the data to pass to callback function
Asynchronously retrieves the next
Gio.SocketAddressfrom enumerator and then calls callback, which must callGio.SocketAddressEnumerator.next_finish() to get the result.It is an error to call this multiple times before the previous callback has finished.
- cancellable (
-
do_next_finish(result) virtual¶ Parameters: result ( Gio.AsyncResult) – aGio.AsyncResultReturns: a Gio.SocketAddress(owned by the caller), orNoneon error (in which case error will be set) or if there are no more addresses.Return type: Gio.SocketAddressRetrieves the result of a completed call to
Gio.SocketAddressEnumerator.next_async(). SeeGio.SocketAddressEnumerator.next() for more information about error handling.
-