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

Unified Diff: dart/samples/dartiverse_search/web/client.dart

Issue 68633002: Version 1.0.0.2 (Closed) Base URL: http://dart.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « dart/samples/dartiverse_search/bin/server.dart ('k') | dart/tools/VERSION » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/samples/dartiverse_search/web/client.dart
===================================================================
--- dart/samples/dartiverse_search/web/client.dart (revision 30146)
+++ dart/samples/dartiverse_search/web/client.dart (working copy)
@@ -10,6 +10,7 @@
class Client {
static const Duration RECONNECT_DELAY = const Duration(milliseconds: 500);
+ bool connectPending = false;
WebSocket webSocket;
final DivElement log = new DivElement();
SearchInputElement searchElement = querySelector('#q');
@@ -25,6 +26,7 @@
}
void connect() {
+ connectPending = false;
webSocket = new WebSocket('ws://${Uri.base.host}:${Uri.base.port}/ws');
webSocket.onOpen.first.then((_) {
onConnected();
@@ -50,8 +52,10 @@
}
void onDisconnected() {
+ if (connectPending) return;
+ connectPending = true;
+ setStatus('Disconnected - start \'bin/server.dart\' to continue');
searchElement.disabled = true;
- setStatus('Disconnected - start \'bin/server.dart\' to continue');
new Timer(RECONNECT_DELAY, connect);
}
« no previous file with comments | « dart/samples/dartiverse_search/bin/server.dart ('k') | dart/tools/VERSION » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698