Safe Haskell | None |
---|---|
Language | Haskell2010 |
Network operations using the connection package.
Synopsis
- type Port = Int
- type HostName = String
- data Handle = Handle {
- hConn :: !Connection
- hContext :: !ConnectionContext
- defaultTLSSettings :: TLSSettings
- mkParams :: HostName -> Int -> ConnectionParams
- openParams :: MonadIO m => ConnectionParams -> m Handle
- open :: MonadIO m => HostName -> Port -> m Handle
- openTls :: MonadIO m => HostName -> Port -> m Handle
- close :: MonadIO m => Handle -> m ()
- withHandleParams :: (MonadMask m, MonadIO m) => ConnectionParams -> (Handle -> m b) -> m b
- withHandle :: (MonadMask m, MonadIO m) => HostName -> Port -> (Handle -> m b) -> m b
- withSecureHandle :: (MonadMask m, MonadIO m) => HostName -> Port -> (Handle -> m b) -> m b
Documentation
Network handle, containing enough information to both communicate a connection, and upgrade to TLS.
Handle | |
|
Instances
Connection Handle Source # | |
Defined in Network.Mail.Assumpta.Internal.Net | |
type Params Handle Source # | |
Defined in Network.Mail.Assumpta.Internal.Net | |
type Cstrt Handle Source # | |
Defined in Network.Mail.Assumpta.Internal.Net |
defaultTLSSettings :: TLSSettings Source #
default TLS settings
openParams :: MonadIO m => ConnectionParams -> m Handle Source #
Open a network Handle
with the specified ConnectionParams
open :: MonadIO m => HostName -> Port -> m Handle Source #
Open a network Handle
to the specified hostname and port
openTls :: MonadIO m => HostName -> Port -> m Handle Source #
Open a secure network Handle
to the specified hostname and port
using the default TLS settings (defaultTLSSettings
)
withHandleParams :: (MonadMask m, MonadIO m) => ConnectionParams -> (Handle -> m b) -> m b Source #
withHandleParams p a
Given some parameters p
(hostname, port etc) for opening a Handle
:
open a handle, run some action a
with it, then
close.