Safe Haskell | None |
---|---|
Language | Haskell2010 |
- assertE :: Exception e => Bool -> e -> IO ()
- noteE :: Exception e => Maybe r -> e -> IO r
- hoistE :: Exception e => Either e r -> IO r
- (~=) :: String -> String -> Bool
- dropTrailingChar :: ByteString -> ByteString
- withConnection :: ConnectionData -> (Connection -> IO a) -> IO a
- mkConnection :: ConnectionData -> IO Connection
- connectionGetExact :: Connection -> Int -> IO ByteString
Documentation
dropTrailingChar :: ByteString -> ByteString Source #
HTTP ends newlines with rn sequence, but the connection
package doesn't
know this so we need to drop the r after reading lines. This should only be
needed in your compatibility with the HTTP library.
withConnection :: ConnectionData -> (Connection -> IO a) -> IO a Source #
Creates a new connection to Hostname
from an already initialized ConnectionContext
.
Internally it uses bracket
to cleanup the connection.
mkConnection :: ConnectionData -> IO Connection Source #
Creates a connection from a ConnectionData
value, returning it. It
is the user's responsibility to close this appropriately.
connectionGetExact :: Connection -> Int -> IO ByteString Source #
Get exact count of bytes from a connection.
The size argument is the exact amount that must be returned to the user.
The call will wait until all data is available. Hence, it behaves like
hGet
.
On end of input, connectionGetExact
will throw an isEOFError
exception.
Taken from: https://github.com/vincenthz/hs-connection/issues/9