on master help sign in
Update network module docs
commitb85142280973052229c212ee04b023e4e968bc78 authorHarendra Kumar <harendra@composewell.com> dateWed 2 Nov 2022, 05:31 (4 years ago) parent703823b
3 files changed+10−12
src/Streamly/Internal/Network/Socket.hs+1−1 src/Streamly/Network/Inet/TCP.hs+1−1 src/Streamly/Network/Socket.hs+8−10
src/Streamly/Internal/Network/Socket.hs+1−1
@@ -315,7 +315,7 @@ writeArrayWith f h arr = A.asPtrUnsafe arr $ \ptr -> f h (castPtr ptr) aLen
315315
316316 aLen = A.byteLength arr
317317
318−-- | Write an Array to a file handle.
318+-- | Write an Array to a socket.
319319--
320320{-# INLINABLE putChunk #-}
321321putChunk :: Unbox a => Socket -> Array a -> IO ()
src/Streamly/Network/Inet/TCP.hs+1−1
@@ -9,7 +9,7 @@
99--
1010-- Combinators to build Inet/TCP clients and servers.
1111--
12−-- > import qualified Streamly.Network.Inet.TCP as TCP
12+-- >>> import qualified Streamly.Network.Inet.TCP as TCP
1313--
1414
1515module Streamly.Network.Inet.TCP
src/Streamly/Network/Socket.hs+8−10
@@ -7,18 +7,17 @@
77-- Stability : released
88-- Portability : GHC
99--
10−-- This module provides Array and stream based socket operations to connect to
11−-- remote hosts, to receive connections from remote hosts, and to read and
12−-- write streams and arrays of bytes to and from network sockets.
10+-- This module provides socket based streaming APIs to to receive connections
11+-- from remote hosts, and to read and write from and to network sockets.
1312--
1413-- For basic socket types and operations please consult the @Network.Socket@
1514-- module of the <http://hackage.haskell.org/package/network network> package.
1615--
1716-- = Examples
1817--
19−-- To write a server, use the 'accept' unfold to start listening for
20−-- connections from clients. 'accept' supplies a stream of connected sockets.
21−-- We can map an effectful action on this socket stream to handle the
18+-- To write a server, use the 'acceptor' unfold to start listening for
19+-- connections from clients. 'acceptor' generates a stream of connected
20+-- sockets. We can map an effectful action on this socket stream to handle the
2221-- connections. The action would typically use socket reading and writing
2322-- operations to communicate with the remote host. We can read/write a stream
2423-- of bytes or a stream of chunks of bytes ('Array').
@@ -27,7 +26,6 @@
2726-- this example can be written even more succinctly by using higher level
2827-- operations from "Streamly.Network.Inet.TCP" module.
2928--
30−--
3129-- >>> :set -XFlexibleContexts
3230-- >>>
3331-- >>> import Data.Function ((&))
@@ -65,10 +63,10 @@
6563-- Read IO requests to connected stream sockets are performed in chunks of
6664-- 'Streamly.Internal.Data.Array.Unboxed.Type.defaultChunkSize'. Unless
6765-- specified otherwise in the API, writes are collected into chunks of
68−-- 'Streamly.Internal.Data.Array.Unboxed.Type.defaultChunkSize' before they are
69−-- written to the socket. APIs are provided to control the chunking behavior.
66+-- 'Streamly.Internal.System.IO.defaultChunkSize' before they are written to
67+-- the socket.
7068--
71−-- > import qualified Streamly.Network.Socket as Socket
69+-- >>> import qualified Streamly.Network.Socket as Socket
7270--
7371-- = See Also
7472--