on master help sign in
Update network module docs
b851422Harendra Kumar
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
315
315
316 aLen = A.byteLength arr
316 aLen = A.byteLength arr
317
317
318−-- | Write an Array to a file handle.
318+-- | Write an Array to a socket.
319--
319--
320{-# INLINABLE putChunk #-}
320{-# INLINABLE putChunk #-}
321putChunk :: Unbox a => Socket -> Array a -> IO ()
321putChunk :: Unbox a => Socket -> Array a -> IO ()
src/Streamly/Network/Inet/TCP.hs+1−1
@@ -9,7 +9,7 @@
9--
9--
10-- Combinators to build Inet/TCP clients and servers.
10-- Combinators to build Inet/TCP clients and servers.
11--
11--
12−-- > import qualified Streamly.Network.Inet.TCP as TCP
12+-- >>> import qualified Streamly.Network.Inet.TCP as TCP
13--
13--
14
14
15module Streamly.Network.Inet.TCP
15module Streamly.Network.Inet.TCP
src/Streamly/Network/Socket.hs+8−10
@@ -7,18 +7,17 @@
7-- Stability : released
7-- Stability : released
8-- Portability : GHC
8-- Portability : GHC
9--
9--
10−-- This module provides Array and stream based socket operations to connect to
10+-- This module provides socket based streaming APIs to to receive connections
11−-- remote hosts, to receive connections from remote hosts, and to read and
11+-- from remote hosts, and to read and write from and to network sockets.
12−-- write streams and arrays of bytes to and from network sockets.
13--
12--
14-- For basic socket types and operations please consult the @Network.Socket@
13-- For basic socket types and operations please consult the @Network.Socket@
15-- module of the <http://hackage.haskell.org/package/network network> package.
14-- module of the <http://hackage.haskell.org/package/network network> package.
16--
15--
17-- = Examples
16-- = Examples
18--
17--
19−-- To write a server, use the 'accept' unfold to start listening for
18+-- To write a server, use the 'acceptor' unfold to start listening for
20−-- connections from clients. 'accept' supplies a stream of connected sockets.
19+-- connections from clients. 'acceptor' generates a stream of connected
21−-- We can map an effectful action on this socket stream to handle the
20+-- sockets. We can map an effectful action on this socket stream to handle the
22-- connections. The action would typically use socket reading and writing
21-- connections. The action would typically use socket reading and writing
23-- operations to communicate with the remote host. We can read/write a stream
22-- operations to communicate with the remote host. We can read/write a stream
24-- of bytes or a stream of chunks of bytes ('Array').
23-- of bytes or a stream of chunks of bytes ('Array').
@@ -27,7 +26,6 @@
27-- this example can be written even more succinctly by using higher level
26-- this example can be written even more succinctly by using higher level
28-- operations from "Streamly.Network.Inet.TCP" module.
27-- operations from "Streamly.Network.Inet.TCP" module.
29--
28--
30−--
31-- >>> :set -XFlexibleContexts
29-- >>> :set -XFlexibleContexts
32-- >>>
30-- >>>
33-- >>> import Data.Function ((&))
31-- >>> import Data.Function ((&))
@@ -65,10 +63,10 @@
65-- Read IO requests to connected stream sockets are performed in chunks of
63-- Read IO requests to connected stream sockets are performed in chunks of
66-- 'Streamly.Internal.Data.Array.Unboxed.Type.defaultChunkSize'. Unless
64-- 'Streamly.Internal.Data.Array.Unboxed.Type.defaultChunkSize'. Unless
67-- specified otherwise in the API, writes are collected into chunks of
65-- specified otherwise in the API, writes are collected into chunks of
68−-- 'Streamly.Internal.Data.Array.Unboxed.Type.defaultChunkSize' before they are
66+-- 'Streamly.Internal.System.IO.defaultChunkSize' before they are written to
69−-- written to the socket. APIs are provided to control the chunking behavior.
67+-- the socket.
70--
68--
71−-- > import qualified Streamly.Network.Socket as Socket
69+-- >>> import qualified Streamly.Network.Socket as Socket
72--
70--
73-- = See Also
71-- = See Also
74--
72--