on e25db62 help sign in
61 lines 1.6 kB history raw
1-- |
2-- Module : Streamly.Network.Socket
3-- Copyright : (c) 2018 Composewell Technologies
4--
5-- License : BSD3
6-- Maintainer : streamly@composewell.com
7-- Stability : experimental
8-- Portability : GHC
9--
10-- Read and write streams and arrays to and from network sockets. Socket IO
11-- APIs are quite similar to "Streamly.Memory.Array" read write APIs and almost
12-- identical to the sequential streaming APIs in "Streamly.Internal.FileSystem.File".
13--
14-- Read IO requests to the socket are performed in chunks of 32KiB, this is
15-- referred to as @defaultChunkSize@ in the documentation. One IO request may
16-- or may not read the full chunk. Unless specified otherwise in the API,
17-- writes are collected into chunks of @defaultChunkSize@ before they are
18-- written to the socket. APIs are provided to control the chunking and
19-- framing behavior.
20--
21-- > import qualified Streamly.Network.Socket as SK
22--
24module Streamly.Network.Socket
25 (
26 -- * Use a socket
27 withSocketM
28 , withSocket
30 -- * Read from connection
31 , read
32 -- , readUtf8
33 -- , readLines
34 -- , readFrames
35 -- , readByChunks
37 -- -- * Array Read
38 -- , readArrayUpto
39 -- , readArrayOf
41 -- , readArraysUpto
42 , readArraysOf
43 -- , readArrays
45 -- * Write to connection
46 , write
47 -- , writeUtf8
48 -- , writeUtf8ByLines
49 -- , writeByFrames
50 -- , writeInChunksOf
52 -- -- * Array Write
53 -- , writeArray
54 , writeArrays
56 -- reading/writing datagrams
57 )
58where
60import Streamly.Internal.Network.Socket
61import Prelude hiding (read)