Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria (garetxe@gmail.com) |
Safe Haskell | None |
Language | Haskell2010 |
Enumerator type for objects that contain or generate
SocketAddress
<!-- -->es.
- newtype SocketAddressEnumerator = SocketAddressEnumerator (ManagedPtr SocketAddressEnumerator)
- class GObject o => IsSocketAddressEnumerator o
- toSocketAddressEnumerator :: (MonadIO m, IsSocketAddressEnumerator o) => o -> m SocketAddressEnumerator
- noSocketAddressEnumerator :: Maybe SocketAddressEnumerator
- socketAddressEnumeratorNext :: (HasCallStack, MonadIO m, IsSocketAddressEnumerator a, IsCancellable b) => a -> Maybe b -> m SocketAddress
- socketAddressEnumeratorNextAsync :: (HasCallStack, MonadIO m, IsSocketAddressEnumerator a, IsCancellable b) => a -> Maybe b -> Maybe AsyncReadyCallback -> m ()
- socketAddressEnumeratorNextFinish :: (HasCallStack, MonadIO m, IsSocketAddressEnumerator a, IsAsyncResult b) => a -> b -> m SocketAddress
Exported types
newtype SocketAddressEnumerator Source #
Memory-managed wrapper type.
class GObject o => IsSocketAddressEnumerator o Source #
Type class for types which can be safely cast to SocketAddressEnumerator
, for instance with toSocketAddressEnumerator
.
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
next
socketAddressEnumeratorNext Source #
:: (HasCallStack, MonadIO m, IsSocketAddressEnumerator a, IsCancellable b) | |
=> a |
|
-> Maybe b |
|
-> m SocketAddress | Returns: a |
Retrieves the next SocketAddress
from enumerator
. Note that this
may block for some amount of time. (Eg, a NetworkAddress
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 #
:: (HasCallStack, MonadIO m, IsSocketAddressEnumerator a, IsCancellable b) | |
=> a |
|
-> Maybe b |
|
-> Maybe AsyncReadyCallback |
|
-> m () |
Asynchronously retrieves the next SocketAddress
from enumerator
and then calls callback
, which must call
socketAddressEnumeratorNextFinish
to get the result.
nextFinish
socketAddressEnumeratorNextFinish Source #
:: (HasCallStack, MonadIO m, IsSocketAddressEnumerator a, IsAsyncResult b) | |
=> a |
|
-> b |
|
-> m SocketAddress | Returns: a |
Retrieves the result of a completed call to
socketAddressEnumeratorNextAsync
. See
socketAddressEnumeratorNext
for more information about
error handling.