on cce586a help sign in
streamly/examples/FromFileClient.hs
16 lines 565 B history raw
1-- A TCP client that does the following:
2-- * Reads multiple filenames passed on the command line
3-- * Opens as many concurrent connections to the server
4-- * Sends all the files concurrently to the server
6import System.Environment (getArgs)
8import Streamly
9import qualified Streamly.Prelude as S
10import qualified Streamly.FileSystem.File as File
11import qualified Streamly.Network.Client as Client
13main :: IO ()
14main =
15 let sendFile = Client.writeArrays (127,0,0,1) 8090 . File.readArrays
16 in getArgs >>= S.drain . parallely . S.mapM sendFile . S.fromList