Copyright | (c) 2014-2015, Peter Trško |
---|---|
License | BSD3 |
Maintainer | peter.trsko@gmail.com |
Stability | unstable (internal module) |
Portability | non-portable (CPP, FlexibleContexts, NoImplicitPrelude) |
Safe Haskell | None |
Language | Haskell2010 |
Module defines helper functions that would be ideally provided by streaming-commons package and some wrappers with specialised type signatures.
Internal packages are here to provide access to internal definitions for library writers, but they should not be used in application code.
Preferably use qualified import, e.g.:
import qualified Data.ConnectionPool.Internal.Streaming as Internal
This module doesn't neither depend on resource-pool package nor any other module of this package, and it shoud stay that way. This module uses CPP to get OS specific things right. Most importantly Windows doesn't support UNIX Sockets.
Please, bear above in mind when doing modifications.
- acquireTcpClientConnection :: ClientSettings -> IO (Socket, SockAddr)
- runTcpApp :: MonadBaseControl IO m => Maybe SockAddr -> (AppData -> m r) -> Socket -> SockAddr -> m r
- runTcpAppImpl :: MonadBaseControl IO m => Maybe SockAddr -> Socket -> SockAddr -> (AppData -> m r) -> m r
- runUnixApp :: MonadBaseControl IO m => (AppDataUnix -> m r) -> Socket -> () -> m r
- runUnixAppImpl :: MonadBaseControl IO m => Socket -> (AppDataUnix -> m r) -> m r
TCP
acquireTcpClientConnection :: ClientSettings -> IO (Socket, SockAddr) Source
Wrapper for getSocketFamilyTCP
that takes ClientSettings
instead of
individual parameters.
runTcpApp :: MonadBaseControl IO m => Maybe SockAddr -> (AppData -> m r) -> Socket -> SockAddr -> m r Source
Wrapper for runTcpAppImpl
with a type signature that is more natural
for implementing a TCP specific
withConnection
.
runTcpAppImpl :: MonadBaseControl IO m => Maybe SockAddr -> Socket -> SockAddr -> (AppData -> m r) -> m r Source
Simplified runTCPClient
and
runTCPServer
that provides only construction of
AppData
and passing it to a callback function.
Unix Socket
runUnixApp :: MonadBaseControl IO m => (AppDataUnix -> m r) -> Socket -> () -> m r Source
Wrapper for runUnixAppImpl
with a type signature that is more natural
for implementing a UNIX Socket specific
withConnection
.
runUnixAppImpl :: MonadBaseControl IO m => Socket -> (AppDataUnix -> m r) -> m r Source
Simplified runUnixClient
and
runUnixServer
that provides only construction of
AppDataUnix
and passing it to a callback function.