mp3decoder finally passes the flow-down rule checking.
[IRC.git] / Robust / src / Tests / ServerExample.java
1 /* Startup object is generated with the initialstate flag set by the
2  *  system to start the computation up */
3
4 task Startup(StartupObject s {initialstate}) {
5     System.printString("Starting\n");
6     ServerSocket ss=new ServerSocket(8000);
7     System.printString("Creating ServerSocket\n");
8     taskexit(s {!initialstate}); /* Turns initial state flag off, so this task won't refire */
9 }
10
11 task AcceptConnection(ServerSocket ss{SocketPending}) {
12     Socket s=ss.accept();
13     System.printString("Creating Socket\n");
14 }
15
16 task IncomingIO(Socket s{IOPending}) {
17     byte[] b=new byte[10];
18     int length=s.read(b);
19     byte[] b2=new byte[length];
20     int i;
21     for(i=0;i<length;i++) {
22         b2[i]=b[i];
23     }
24     System.printString("receiving input\n");
25     s.write(b2);
26 }
27