Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(86)

Side by Side Diff: src/site/samples/websockets/example/websocket_sample.dart

Issue 30853002: Added several more HTML5 samples (Closed) Base URL: https://github.com/dart-lang/dartlang.org.git@master
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 import "dart:html" as o;import "dart:async" as EB;class q{static const s="Chrom e";static const t="Firefox";static const u="Internet Explorer";static const v ="Safari";final n;final minimumVersion;const q(this.n,[this.minimumVersion]);} class AB{const AB();}class BB{final name;const BB(this.name);}class CB{const CB ();}class DB{const DB();}var i;j( k){var h=o.query('#output');var g=k;if(!h.text .isEmpty){g="${h.text}\n${g}";}h.text=g;} l([ h=2]){var k=false;j("Connecting to websocket");i=new o.WebSocket('ws://echo.websocket.org'); m(){if(!k){new EB.Tim er(new Duration(milliseconds:1000*h),()=>l(h*2));}k=true;}i.onOpen.listen((g){j( 'Connected');i.send('Hello from Dart!');});i.onClose.listen((g){j('Websocket clo sed, retrying in ${h} seconds');m();});i.onError.listen((g){j("Error connecting to ws");m();});i.onMessage.listen(( g){j('Received message: ${g.data}');});} mai n(){l();}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698