1-- A concurrent TCP server that echoes everything that it receives.
3import Control.Exception (finally)
4import Control.Monad.IO.Class (liftIO)
6import Streamly.Network.Socket
7import qualified Network.Socket as Net
8import qualified Streamly.Network.Inet.TCP as TCP
9import qualified Streamly.Prelude as S
13 $ parallely $ S.mapM (useWith echo)
14 $ serially $ S.unfold TCP.acceptOnPort 8091
17 S.fold (writeChunks sk)
18 $ S.unfold readChunksWithBufferOf (32768, sk)
19 useWith f sk = finally (f sk) (liftIO (Net.close sk))
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list