License | BSD-style |
---|---|
Maintainer | Vincent Hanquez <vincent@snarc.org> |
Stability | experimental |
Portability | portable |
Safe Haskell | None |
Language | Haskell98 |
Network.Connection
Contents
Description
Simple connection abstraction
- data Connection
- connectionID :: Connection -> ConnectionID
- data ConnectionParams = ConnectionParams {}
- data TLSSettings
- data ProxySettings
- type SockSettings = ProxySettings
- data LineTooLong = LineTooLong
- data HostNotResolved = HostNotResolved String
- data HostCannotConnect = HostCannotConnect String [IOException]
- initConnectionContext :: IO ConnectionContext
- data ConnectionContext
- connectFromHandle :: ConnectionContext -> Handle -> ConnectionParams -> IO Connection
- connectFromSocket :: ConnectionContext -> Socket -> ConnectionParams -> IO Connection
- connectTo :: ConnectionContext -> ConnectionParams -> IO Connection
- connectionClose :: Connection -> IO ()
- connectionGet :: Connection -> Int -> IO ByteString
- connectionGetExact :: Connection -> Int -> IO ByteString
- connectionGetChunk :: Connection -> IO ByteString
- connectionGetChunk' :: Connection -> (ByteString -> (a, ByteString)) -> IO a
- connectionGetLine :: Int -> Connection -> IO ByteString
- connectionWaitForInput :: Connection -> Int -> IO Bool
- connectionPut :: Connection -> ByteString -> IO ()
- connectionSetSecure :: ConnectionContext -> Connection -> TLSSettings -> IO ()
- connectionIsSecure :: Connection -> IO Bool
Type for a connection
data Connection Source #
This opaque type represent a connection to a destination.
connectionID :: Connection -> ConnectionID Source #
return a simple tuple of the port and hostname that we're connected to.
data ConnectionParams Source #
Connection Parameters to establish a Connection.
The strict minimum is an hostname and the port.
If you need to establish a TLS connection, you should make sure connectionUseSecure is correctly set.
If you need to connect through a SOCKS, you should make sure connectionUseSocks is correctly set.
Constructors
ConnectionParams | |
Fields
|
data TLSSettings Source #
TLS Settings that can be either expressed as simple settings, or as full blown TLS.Params settings.
Unless you need access to parameters that are not accessible through the simple settings, you should use TLSSettingsSimple.
Constructors
TLSSettingsSimple | Simple TLS settings. recommended to use. |
Fields
| |
TLSSettings ClientParams | full blown TLS Settings directly using TLS.Params. for power users. |
Instances
data ProxySettings Source #
Proxy settings for the connection.
OtherProxy handles specific application-level proxies like HTTP proxies.
The simple SOCKS settings is just the hostname and portnumber of the SOCKS proxy server.
That's for now the only settings in the SOCKS package, socks password, or any sort of other authentications is not yet implemented.
type SockSettings = ProxySettings Source #
Exceptions
data LineTooLong Source #
This is the exception raised if we reached the user specified limit for the line in ConnectionGetLine.
Constructors
LineTooLong |
Instances
data HostNotResolved Source #
Exception raised when there's no resolution for a specific host
Constructors
HostNotResolved String |
Instances