gi-gio-2.0.25: Gio bindings

CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellNone
LanguageHaskell2010

GI.Gio.Objects.SocketAddressEnumerator

Contents

Description

tSocketAddressEnumerator is an enumerator type for tSocketAddress instances. It is returned by enumeration functions such as socketConnectableEnumerate, which returns a tSocketAddressEnumerator to list each tSocketAddress which could be used to connect to that tSocketConnectable.

Enumeration is typically a blocking operation, so the asynchronous methods socketAddressEnumeratorNextAsync and socketAddressEnumeratorNextFinish should be used where possible.

Each tSocketAddressEnumerator can only be enumerated once. Once socketAddressEnumeratorNext has returned Nothing (and no error), further enumeration with that tSocketAddressEnumerator is not possible, and it can be unreffed.

Synopsis

Exported types

newtype SocketAddressEnumerator Source #

Memory-managed wrapper type.

Instances
Eq SocketAddressEnumerator Source # 
Instance details

Defined in GI.Gio.Objects.SocketAddressEnumerator

GObject SocketAddressEnumerator Source # 
Instance details

Defined in GI.Gio.Objects.SocketAddressEnumerator

Methods

gobjectType :: IO GType

IsGValue SocketAddressEnumerator Source #

Convert SocketAddressEnumerator to and from GValue with toGValue and fromGValue.

Instance details

Defined in GI.Gio.Objects.SocketAddressEnumerator

HasParentTypes SocketAddressEnumerator Source # 
Instance details

Defined in GI.Gio.Objects.SocketAddressEnumerator

type ParentTypes SocketAddressEnumerator Source # 
Instance details

Defined in GI.Gio.Objects.SocketAddressEnumerator

type ParentTypes SocketAddressEnumerator = Object ': ([] :: [Type])

class (GObject o, IsDescendantOf SocketAddressEnumerator o) => IsSocketAddressEnumerator o Source #

Type class for types which can be safely cast to SocketAddressEnumerator, for instance with toSocketAddressEnumerator.

Instances
(GObject o, IsDescendantOf SocketAddressEnumerator o) => IsSocketAddressEnumerator o Source # 
Instance details

Defined in GI.Gio.Objects.SocketAddressEnumerator

toSocketAddressEnumerator :: (MonadIO m, IsSocketAddressEnumerator o) => o -> m SocketAddressEnumerator Source #

Cast to SocketAddressEnumerator, for types for which this is known to be safe. For general casts, use castTo.

noSocketAddressEnumerator :: Maybe SocketAddressEnumerator Source #

A convenience alias for Nothing :: Maybe SocketAddressEnumerator.

Methods

Overloaded methods

next

socketAddressEnumeratorNext Source #

Arguments

:: (HasCallStack, MonadIO m, IsSocketAddressEnumerator a, IsCancellable b) 
=> a

enumerator: a tSocketAddressEnumerator

-> Maybe b

cancellable: optional tCancellable object, Nothing to ignore.

-> m SocketAddress

Returns: a tSocketAddress (owned by the caller), or Nothing on error (in which case *error will be set) or if there are no more addresses. (Can throw GError)

Retrieves the next tSocketAddress from enumerator. Note that this may block for some amount of time. (Eg, a tNetworkAddress may need to do a DNS lookup before it can return an address.) Use socketAddressEnumeratorNextAsync 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 socketAddressEnumeratorNext will return an appropriate error in *error. However, if the first call to socketAddressEnumeratorNext succeeds, then any further internal errors (other than cancellable being triggered) will be ignored.

nextAsync

socketAddressEnumeratorNextAsync Source #

Arguments

:: (HasCallStack, MonadIO m, IsSocketAddressEnumerator a, IsCancellable b) 
=> a

enumerator: a tSocketAddressEnumerator

-> Maybe b

cancellable: optional tCancellable object, Nothing to ignore.

-> Maybe AsyncReadyCallback

callback: a tAsyncReadyCallback to call when the request is satisfied

-> m () 

Asynchronously retrieves the next tSocketAddress from enumerator and then calls callback, which must call socketAddressEnumeratorNextFinish to get the result.

It is an error to call this multiple times before the previous callback has finished.

nextFinish

socketAddressEnumeratorNextFinish Source #

Arguments

:: (HasCallStack, MonadIO m, IsSocketAddressEnumerator a, IsAsyncResult b) 
=> a

enumerator: a tSocketAddressEnumerator

-> b

result: a tAsyncResult

-> m SocketAddress

Returns: a tSocketAddress (owned by the caller), or Nothing on error (in which case *error will be set) or if there are no more addresses. (Can throw GError)

Retrieves the result of a completed call to socketAddressEnumeratorNextAsync. See socketAddressEnumeratorNext for more information about error handling.