comparison tests/roundTrip.ur @ 729:7c6b6c3c7b79

Some client-side error handling
author Adam Chlipala <adamc@hcoop.net>
date Thu, 16 Apr 2009 13:47:20 -0400
parents 2197f0e24a9f
children 8a169fc0838b
comparison
equal deleted inserted replaced
728:2197f0e24a9f 729:7c6b6c3c7b79
24 Buffer.write buf ("B:(" ^ v.1 ^ ", " ^ show v.2 ^ ", " ^ show v.3 ^ ")"); 24 Buffer.write buf ("B:(" ^ v.1 ^ ", " ^ show v.2 ^ ", " ^ show v.3 ^ ")");
25 error <xml>Bail out!</xml>; 25 error <xml>Bail out!</xml>;
26 receiverB () 26 receiverB ()
27 27
28 fun sender s n f = 28 fun sender s n f =
29 sleep 9; 29 sleep 2000;
30 writeBack (s, n, f); 30 writeBack (s, n, f);
31 sender (s ^ "!") (n + 1) (f + 1.23) 31 sender (s ^ "!") (n + 1) (f + 1.23)
32 in 32 in
33 return <xml><body onload={spawn (receiverA ()); spawn (receiverB ()); sender "" 0 0.0}> 33 return <xml><body onload={onDisconnect (alert "Server booted me");
34 onConnectFail (alert "Connection failed");
35 onServerError (fn s => alert ("Server error: " ^ s));
36 spawn (receiverA ()); spawn (receiverB ()); sender "" 0 0.0}>
34 <dyn signal={Buffer.render buf}/> 37 <dyn signal={Buffer.render buf}/>
35 </body></xml> 38 </body></xml>
36 end 39 end