System.IO.Streams.Network

io-streams-1.5.2.2: Simple, composable, and easy-to-use stream I/O

Safe Haskell | None
Language | Haskell2010

System.IO.Streams.Network

Contents

- Sockets to Streams

Description

Converting network `Socket`s to streams.

Synopsis

- socketToStreams :: Socket -> IO (InputStream ByteString, OutputStream ByteString)
- socketToStreamsWithBufferSize :: Int -> Socket -> IO (InputStream ByteString, OutputStream ByteString)

# Sockets to Streams

socketToStreams :: Socket -> IO (InputStream ByteString, OutputStream ByteString) #

Converts a `Socket` to an `InputStream` / `OutputStream` pair. Note that, as is usually the case in `io-streams`, writing a `Nothing` to the generated `OutputStream` does not cause the underlying `Socket` to be closed.

socketToStreamsWithBufferSize #

Arguments

:: Int | how large the receive buffer should be
-> Socket | network socket
-> IO (InputStream ByteString, OutputStream ByteString) |

Converts a `Socket` to an `InputStream` / `OutputStream` pair, with control over the size of the receive buffers. Note that, as is usually the case in `io-streams`, writing a `Nothing` to the generated `OutputStream` does not cause the underlying `Socket` to be closed.