Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | None |
Language | Haskell2010 |
GI.Gio.Structs.SrvTarget
Description
A single target host/port that a network service is running on.
SRV (service) records are used by some network protocols to provide
service-specific aliasing and load-balancing. For example, XMPP
(Jabber) uses SRV records to locate the XMPP server for a domain;
rather than connecting directly to ‘example.com’ or assuming a
specific server hostname like ‘xmpp.example.com’, an XMPP client
would look up the xmpp-client
SRV record for ‘example.com’, and
then connect to whatever host was pointed to by that record.
You can use resolverLookupService
or
resolverLookupServiceAsync
to find the GSrvTarget
s
for a given service. However, if you are simply planning to connect
to the remote service, you can use NetworkService
’s
SocketConnectable
interface and not need to worry about
GSrvTarget
at all.
Synopsis
- newtype SrvTarget = SrvTarget (ManagedPtr SrvTarget)
- type family ResolveSrvTargetMethod (t :: Symbol) o where ...
- data SrvTargetCopyMethodInfo
- srvTargetCopy :: (HasCallStack, MonadIO m) => SrvTarget -> m SrvTarget
- data SrvTargetFreeMethodInfo
- srvTargetFree :: (HasCallStack, MonadIO m) => SrvTarget -> m ()
- data SrvTargetGetHostnameMethodInfo
- srvTargetGetHostname :: (HasCallStack, MonadIO m) => SrvTarget -> m Text
- data SrvTargetGetPortMethodInfo
- srvTargetGetPort :: (HasCallStack, MonadIO m) => SrvTarget -> m Word16
- data SrvTargetGetPriorityMethodInfo
- srvTargetGetPriority :: (HasCallStack, MonadIO m) => SrvTarget -> m Word16
- data SrvTargetGetWeightMethodInfo
- srvTargetGetWeight :: (HasCallStack, MonadIO m) => SrvTarget -> m Word16
- srvTargetNew :: (HasCallStack, MonadIO m) => Text -> Word16 -> Word16 -> Word16 -> m SrvTarget
Exported types
Memory-managed wrapper type.
Constructors
SrvTarget (ManagedPtr SrvTarget) |
Instances
Methods
Click to display all available methods, including inherited ones
type family ResolveSrvTargetMethod (t :: Symbol) o where ... Source #
Equations
ResolveSrvTargetMethod "copy" o = SrvTargetCopyMethodInfo | |
ResolveSrvTargetMethod "free" o = SrvTargetFreeMethodInfo | |
ResolveSrvTargetMethod "getHostname" o = SrvTargetGetHostnameMethodInfo | |
ResolveSrvTargetMethod "getPort" o = SrvTargetGetPortMethodInfo | |
ResolveSrvTargetMethod "getPriority" o = SrvTargetGetPriorityMethodInfo | |
ResolveSrvTargetMethod "getWeight" o = SrvTargetGetWeightMethodInfo | |
ResolveSrvTargetMethod l o = MethodResolutionFailed l o :: Type |
copy
data SrvTargetCopyMethodInfo Source #
Instances
(signature ~ m SrvTarget, MonadIO m) => OverloadedMethod SrvTargetCopyMethodInfo SrvTarget signature Source # | |
Defined in GI.Gio.Structs.SrvTarget Methods overloadedMethod :: SrvTarget -> signature # | |
OverloadedMethodInfo SrvTargetCopyMethodInfo SrvTarget Source # | |
Defined in GI.Gio.Structs.SrvTarget Methods |
Arguments
:: (HasCallStack, MonadIO m) | |
=> SrvTarget |
|
-> m SrvTarget | Returns: a copy of |
Copies target
Since: 2.22
free
data SrvTargetFreeMethodInfo Source #
Instances
(signature ~ m (), MonadIO m) => OverloadedMethod SrvTargetFreeMethodInfo SrvTarget signature Source # | |
Defined in GI.Gio.Structs.SrvTarget Methods overloadedMethod :: SrvTarget -> signature # | |
OverloadedMethodInfo SrvTargetFreeMethodInfo SrvTarget Source # | |
Defined in GI.Gio.Structs.SrvTarget Methods |
Arguments
:: (HasCallStack, MonadIO m) | |
=> SrvTarget |
|
-> m () |
Frees target
Since: 2.22
getHostname
data SrvTargetGetHostnameMethodInfo Source #
Instances
(signature ~ m Text, MonadIO m) => OverloadedMethod SrvTargetGetHostnameMethodInfo SrvTarget signature Source # | |
Defined in GI.Gio.Structs.SrvTarget Methods overloadedMethod :: SrvTarget -> signature # | |
OverloadedMethodInfo SrvTargetGetHostnameMethodInfo SrvTarget Source # | |
Defined in GI.Gio.Structs.SrvTarget Methods |
Arguments
:: (HasCallStack, MonadIO m) | |
=> SrvTarget |
|
-> m Text | Returns: |
Gets target
's hostname (in ASCII form; if you are going to present
this to the user, you should use hostnameIsAsciiEncoded
to
check if it contains encoded Unicode segments, and use
hostnameToUnicode
to convert it if it does.)
Since: 2.22
getPort
data SrvTargetGetPortMethodInfo Source #
Instances
(signature ~ m Word16, MonadIO m) => OverloadedMethod SrvTargetGetPortMethodInfo SrvTarget signature Source # | |
Defined in GI.Gio.Structs.SrvTarget Methods overloadedMethod :: SrvTarget -> signature # | |
OverloadedMethodInfo SrvTargetGetPortMethodInfo SrvTarget Source # | |
Defined in GI.Gio.Structs.SrvTarget Methods |
Arguments
:: (HasCallStack, MonadIO m) | |
=> SrvTarget |
|
-> m Word16 | Returns: |
Gets target
's port
Since: 2.22
getPriority
data SrvTargetGetPriorityMethodInfo Source #
Instances
(signature ~ m Word16, MonadIO m) => OverloadedMethod SrvTargetGetPriorityMethodInfo SrvTarget signature Source # | |
Defined in GI.Gio.Structs.SrvTarget Methods overloadedMethod :: SrvTarget -> signature # | |
OverloadedMethodInfo SrvTargetGetPriorityMethodInfo SrvTarget Source # | |
Defined in GI.Gio.Structs.SrvTarget Methods |
Arguments
:: (HasCallStack, MonadIO m) | |
=> SrvTarget |
|
-> m Word16 | Returns: |
Gets target
's priority. You should not need to look at this;
Resolver
already sorts the targets according to the algorithm in
RFC 2782.
Since: 2.22
getWeight
data SrvTargetGetWeightMethodInfo Source #
Instances
(signature ~ m Word16, MonadIO m) => OverloadedMethod SrvTargetGetWeightMethodInfo SrvTarget signature Source # | |
Defined in GI.Gio.Structs.SrvTarget Methods overloadedMethod :: SrvTarget -> signature # | |
OverloadedMethodInfo SrvTargetGetWeightMethodInfo SrvTarget Source # | |
Defined in GI.Gio.Structs.SrvTarget Methods |
Arguments
:: (HasCallStack, MonadIO m) | |
=> SrvTarget |
|
-> m Word16 | Returns: |
Gets target
's weight. You should not need to look at this;
Resolver
already sorts the targets according to the algorithm in
RFC 2782.
Since: 2.22