diff 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
line wrap: on
line diff
--- a/tests/roundTrip.ur	Thu Apr 16 13:00:40 2009 -0400
+++ b/tests/roundTrip.ur	Thu Apr 16 13:47:20 2009 -0400
@@ -26,11 +26,14 @@
             receiverB ()
 
         fun sender s n f =
-            sleep 9;
+            sleep 2000;
             writeBack (s, n, f);
             sender (s ^ "!") (n + 1) (f + 1.23)
     in
-        return <xml><body onload={spawn (receiverA ()); spawn (receiverB ()); sender "" 0 0.0}>
+        return <xml><body onload={onDisconnect (alert "Server booted me");
+                                  onConnectFail (alert "Connection failed");
+                                  onServerError (fn s => alert ("Server error: " ^ s));
+                                  spawn (receiverA ()); spawn (receiverB ()); sender "" 0 0.0}>
           <dyn signal={Buffer.render buf}/>
         </body></xml>
     end