on 260e31d help sign in
streamly/examples/EchoServer.hs
11 lines 343 B history raw
1-- A concurrent TCP server that echoes everything that it receives.
3import Streamly
4import Streamly.Network.Socket
5import Streamly.Network.Server
6import qualified Streamly.Prelude as S
8main :: IO ()
9main = S.drain
10 $ parallely $ S.mapM (flip withSocket (\sk -> writeArrays sk $ readArrays sk))
11 $ serially $ connectionsOnAllAddrs 8090