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 |
Like NetworkAddress
does with hostnames, NetworkService
provides an easy way to resolve a SRV record, and then attempt to
connect to one of the hosts that implements that service, handling
service priority/weighting, multiple IP addresses, and multiple
address families.
See SrvTarget
for more information about SRV records, and see
SocketConnectable
for and example of using the connectable
interface.
- newtype NetworkService = NetworkService (ManagedPtr NetworkService)
- class GObject o => IsNetworkService o
- toNetworkService :: IsNetworkService o => o -> IO NetworkService
- noNetworkService :: Maybe NetworkService
- data NetworkServiceGetDomainMethodInfo
- networkServiceGetDomain :: (HasCallStack, MonadIO m, IsNetworkService a) => a -> m Text
- data NetworkServiceGetProtocolMethodInfo
- networkServiceGetProtocol :: (HasCallStack, MonadIO m, IsNetworkService a) => a -> m Text
- data NetworkServiceGetSchemeMethodInfo
- networkServiceGetScheme :: (HasCallStack, MonadIO m, IsNetworkService a) => a -> m Text
- data NetworkServiceGetServiceMethodInfo
- networkServiceGetService :: (HasCallStack, MonadIO m, IsNetworkService a) => a -> m Text
- networkServiceNew :: (HasCallStack, MonadIO m) => Text -> Text -> Text -> m NetworkService
- data NetworkServiceSetSchemeMethodInfo
- networkServiceSetScheme :: (HasCallStack, MonadIO m, IsNetworkService a) => a -> Text -> m ()
- data NetworkServiceDomainPropertyInfo
- constructNetworkServiceDomain :: IsNetworkService o => Text -> IO (GValueConstruct o)
- getNetworkServiceDomain :: (MonadIO m, IsNetworkService o) => o -> m Text
- networkServiceDomain :: AttrLabelProxy "domain"
- data NetworkServiceProtocolPropertyInfo
- constructNetworkServiceProtocol :: IsNetworkService o => Text -> IO (GValueConstruct o)
- getNetworkServiceProtocol :: (MonadIO m, IsNetworkService o) => o -> m Text
- networkServiceProtocol :: AttrLabelProxy "protocol"
- data NetworkServiceSchemePropertyInfo
- constructNetworkServiceScheme :: IsNetworkService o => Text -> IO (GValueConstruct o)
- getNetworkServiceScheme :: (MonadIO m, IsNetworkService o) => o -> m Text
- networkServiceScheme :: AttrLabelProxy "scheme"
- setNetworkServiceScheme :: (MonadIO m, IsNetworkService o) => o -> Text -> m ()
- data NetworkServiceServicePropertyInfo
- constructNetworkServiceService :: IsNetworkService o => Text -> IO (GValueConstruct o)
- getNetworkServiceService :: (MonadIO m, IsNetworkService o) => o -> m Text
- networkServiceService :: AttrLabelProxy "service"
Exported types
newtype NetworkService Source #
GObject NetworkService Source # | |
IsObject NetworkService Source # | |
IsSocketConnectable NetworkService Source # | |
IsNetworkService NetworkService Source # | |
((~) * info (ResolveNetworkServiceMethod t NetworkService), MethodInfo * info NetworkService p) => IsLabel t (NetworkService -> p) Source # | |
((~) * info (ResolveNetworkServiceMethod t NetworkService), MethodInfo * info NetworkService p) => IsLabelProxy t (NetworkService -> p) Source # | |
HasAttributeList * NetworkService Source # | |
type AttributeList NetworkService Source # | |
type SignalList NetworkService Source # | |
class GObject o => IsNetworkService o Source #
toNetworkService :: IsNetworkService o => o -> IO NetworkService Source #
Methods
getDomain
data NetworkServiceGetDomainMethodInfo Source #
((~) * signature (m Text), MonadIO m, IsNetworkService a) => MethodInfo * NetworkServiceGetDomainMethodInfo a signature Source # | |
networkServiceGetDomain Source #
:: (HasCallStack, MonadIO m, IsNetworkService a) | |
=> a |
|
-> m Text | Returns: |
Gets the domain that srv
serves. This might be either UTF-8 or
ASCII-encoded, depending on what srv
was created with.
Since: 2.22
getProtocol
data NetworkServiceGetProtocolMethodInfo Source #
((~) * signature (m Text), MonadIO m, IsNetworkService a) => MethodInfo * NetworkServiceGetProtocolMethodInfo a signature Source # | |
networkServiceGetProtocol Source #
:: (HasCallStack, MonadIO m, IsNetworkService a) | |
=> a |
|
-> m Text | Returns: |
Gets srv
's protocol name (eg, "tcp").
Since: 2.22
getScheme
data NetworkServiceGetSchemeMethodInfo Source #
((~) * signature (m Text), MonadIO m, IsNetworkService a) => MethodInfo * NetworkServiceGetSchemeMethodInfo a signature Source # | |
networkServiceGetScheme Source #
:: (HasCallStack, MonadIO m, IsNetworkService a) | |
=> a |
|
-> m Text | Returns: |
Get's the URI scheme used to resolve proxies. By default, the service name is used as scheme.
Since: 2.26
getService
data NetworkServiceGetServiceMethodInfo Source #
((~) * signature (m Text), MonadIO m, IsNetworkService a) => MethodInfo * NetworkServiceGetServiceMethodInfo a signature Source # | |
networkServiceGetService Source #
:: (HasCallStack, MonadIO m, IsNetworkService a) | |
=> a |
|
-> m Text | Returns: |
Gets srv
's service name (eg, "ldap").
Since: 2.22
new
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> Text |
|
-> Text |
|
-> m NetworkService | Returns: a new |
Creates a new NetworkService
representing the given service
,
protocol
, and domain
. This will initially be unresolved; use the
SocketConnectable
interface to resolve it.
Since: 2.22
setScheme
data NetworkServiceSetSchemeMethodInfo Source #
((~) * signature (Text -> m ()), MonadIO m, IsNetworkService a) => MethodInfo * NetworkServiceSetSchemeMethodInfo a signature Source # | |
networkServiceSetScheme Source #
:: (HasCallStack, MonadIO m, IsNetworkService a) | |
=> a |
|
-> Text |
|
-> m () |
Set's the URI scheme used to resolve proxies. By default, the service name is used as scheme.
Since: 2.26
Properties
domain
data NetworkServiceDomainPropertyInfo Source #
constructNetworkServiceDomain :: IsNetworkService o => Text -> IO (GValueConstruct o) Source #
getNetworkServiceDomain :: (MonadIO m, IsNetworkService o) => o -> m Text Source #
networkServiceDomain :: AttrLabelProxy "domain" Source #
protocol
data NetworkServiceProtocolPropertyInfo Source #
constructNetworkServiceProtocol :: IsNetworkService o => Text -> IO (GValueConstruct o) Source #
getNetworkServiceProtocol :: (MonadIO m, IsNetworkService o) => o -> m Text Source #
networkServiceProtocol :: AttrLabelProxy "protocol" Source #
scheme
data NetworkServiceSchemePropertyInfo Source #
constructNetworkServiceScheme :: IsNetworkService o => Text -> IO (GValueConstruct o) Source #
getNetworkServiceScheme :: (MonadIO m, IsNetworkService o) => o -> m Text Source #
networkServiceScheme :: AttrLabelProxy "scheme" Source #
setNetworkServiceScheme :: (MonadIO m, IsNetworkService o) => o -> Text -> m () Source #
service
data NetworkServiceServicePropertyInfo Source #
constructNetworkServiceService :: IsNetworkService o => Text -> IO (GValueConstruct o) Source #
getNetworkServiceService :: (MonadIO m, IsNetworkService o) => o -> m Text Source #
networkServiceService :: AttrLabelProxy "service" Source #