git.iko.soy/distributed-process
on master help sign in
Add documentation to DemoTCP example.
commit73704466d5480d6648834f1ed0b33a31053ee08f authorNicolas Wu <nick@well-typed.com> dateTue 10 Jan 2012, 17:55 (15 years ago) parentfc5d2ad
1 file changed+14−1
examples/DemoTCP.hs+14−1
examples/DemoTCP.hs+14−1
@@ -14,7 +14,20 @@ import Debug.Trace
1414type ChanId = Int
1515
1616-- | This example demonstrates how a master can be connected to slaves using
17−-- the transport layer.
17+-- the transport layer. After compiling, the following will initialize a new
18+-- master that waits for two clients to connect on the local machine:
19+--
20+-- ./DemoTCP 127.0.0.1 8080 2
21+--
22+-- Following this, two slaves should be created that will connect to the master:
23+--
24+-- ./DemoTCP 127.0.0.1 8081
25+-- ./DemoTCP 127.0.0.1 8082
26+--
27+-- Once the connection is established, the slaves will provide the master
28+-- with their SendAddr. The master then decodes this, and sends a message
29+-- back. After processing this message, the slaves respond to the master,
30+-- which then outputs some data.
1831main :: IO ()
1932main = do
2033 args <- getArgs