mongoDB-2.0.9: Driver (client) for MongoDB, a free, scalable, fast, document DBMS

Safe HaskellSafe
LanguageHaskell2010

Database.MongoDB.Internal.Connection

Description

This module defines a connection interface. It could be a regular network connection, TLS connection, a mock or anything else.

Synopsis

Documentation

data Connection Source

Abstract connection interface

read should return null on EOF

Constructors

Connection 

Fields

read :: IO ByteString
 
unread :: ByteString -> IO ()
 
write :: ByteString -> IO ()
 
flush :: IO ()
 
close :: IO ()
 

readExactly :: Connection -> Int -> IO ByteString Source

Read specified number of bytes

If EOF is reached before N bytes then raise EOF exception.

fromHandle :: Handle -> IO Connection Source

Make connection form handle