conduit-extra-1.3.6: Batteries included conduit: adapters for common libraries.

Safe Haskell | Safe-Inferred
Language | Haskell2010

Data.Conduit.Network.Unix

Contents

- Basic utilities
- Simple server/client interface
  - Server
  - Client
  - Getters
  - Setters

Synopsis

- sourceSocket :: MonadIO m => Socket -> ConduitT i ByteString m ()
- sinkSocket :: MonadIO m => Socket -> ConduitT ByteString o m ()
- data AppDataUnix
- appSource :: (HasReadWrite ad, MonadIO m) => ad -> ConduitT i ByteString m ()
- appSink :: (HasReadWrite ad, MonadIO m) => ad -> ConduitT ByteString o m ()
- data ServerSettingsUnix
- serverSettings :: FilePath -> ServerSettingsUnix
- runUnixServer :: ServerSettingsUnix -> (AppDataUnix -> IO ()) -> IO a
- data ClientSettingsUnix
- clientSettings :: FilePath -> ClientSettingsUnix
- runUnixClient :: ClientSettingsUnix -> (AppDataUnix -> IO a) -> IO a
- getPath :: HasPath a => a -> FilePath
- getAfterBind :: HasAfterBind a => a -> Socket -> IO ()
- setPath :: HasPath a => FilePath -> a -> a
- setAfterBind :: HasAfterBind a => (Socket -> IO ()) -> a -> a

# Basic utilities

sourceSocket :: MonadIO m => Socket -> ConduitT i ByteString m () Source #

Stream data from the socket.

This function does not automatically close the socket.

Since 0.0.0

sinkSocket :: MonadIO m => Socket -> ConduitT ByteString o m () Source #

Stream data to the socket.

This function does not automatically close the socket.

Since 0.0.0

# Simple server/client interface

data AppDataUnix Source #

The data passed to a Unix domain sockets `Application`.

#### Instances

Instances details

HasReadWrite AppDataUnix |
Instance details Defined in Data.Streaming.Network Methods readLens :: Functor f => (IO ByteString -> f (IO ByteString)) -> AppDataUnix -> f AppDataUnix Source # writeLens :: Functor f => ((ByteString -> IO ()) -> f (ByteString -> IO ())) -> AppDataUnix -> f AppDataUnix Source #

appSource :: (HasReadWrite ad, MonadIO m) => ad -> ConduitT i ByteString m () Source #

appSink :: (HasReadWrite ad, MonadIO m) => ad -> ConduitT ByteString o m () Source #

## Server

data ServerSettingsUnix Source #

Settings for a Unix domain sockets server.

#### Instances

Instances details

HasAfterBind ServerSettingsUnix |
Instance details Defined in Data.Streaming.Network Methods afterBindLens :: Functor f => ((Socket -> IO ()) -> f (Socket -> IO ())) -> ServerSettingsUnix -> f ServerSettingsUnix Source #
HasPath ServerSettingsUnix |
Instance details Defined in Data.Streaming.Network Methods pathLens :: Functor f => (FilePath -> f FilePath) -> ServerSettingsUnix -> f ServerSettingsUnix Source #
HasReadBufferSize ServerSettingsUnix | Since 0.1.13
Instance details Defined in Data.Streaming.Network Methods readBufferSizeLens :: Functor f => (Int -> f Int) -> ServerSettingsUnix -> f ServerSettingsUnix Source #

serverSettings :: FilePath -> ServerSettingsUnix Source #

runUnixServer :: ServerSettingsUnix -> (AppDataUnix -> IO ()) -> IO a Source #

Run an `Application` with the given settings. This function will create a new listening socket, accept connections on it, and spawn a new thread for each connection.

## Client

data ClientSettingsUnix Source #

Settings for a Unix domain sockets client.

#### Instances

Instances details

HasPath ClientSettingsUnix |
Instance details Defined in Data.Streaming.Network Methods pathLens :: Functor f => (FilePath -> f FilePath) -> ClientSettingsUnix -> f ClientSettingsUnix Source #
HasReadBufferSize ClientSettingsUnix | Since 0.1.14
Instance details Defined in Data.Streaming.Network Methods readBufferSizeLens :: Functor f => (Int -> f Int) -> ClientSettingsUnix -> f ClientSettingsUnix Source #

clientSettings :: FilePath -> ClientSettingsUnix Source #

runUnixClient :: ClientSettingsUnix -> (AppDataUnix -> IO a) -> IO a Source #

Run an `Application` by connecting to the specified server.

## Getters

getPath :: HasPath a => a -> FilePath Source #

getAfterBind :: HasAfterBind a => a -> Socket -> IO () Source #

## Setters

setPath :: HasPath a => FilePath -> a -> a Source #

setAfterBind :: HasAfterBind a => (Socket -> IO ()) -> a -> a Source #