on 5da3375 help sign in
57 lines 1.5 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 -- * Read from connection
27 read
28 -- , readUtf8
29 -- , readLines
30 -- , readFrames
31 -- , readByChunks
33 -- -- * Array Read
34 -- , readArrayUpto
35 -- , readArrayOf
37 -- , readArraysUpto
38 , readArraysOf
39 -- , readArrays
41 -- * Write to connection
42 , write
43 -- , writeUtf8
44 -- , writeUtf8ByLines
45 -- , writeByFrames
46 -- , writeInChunksOf
48 -- -- * Array Write
49 -- , writeArray
50 , writeArrays
52 -- reading/writing datagrams
53 )
54where
56import Streamly.Internal.Network.Socket
57import Prelude hiding (read)