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

Side by Side Diff: samples/chat/chat_server.dart

Issue 8992007: Make the repeating argument to timers optional. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 9 years 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #library("chat_server.dart"); 5 #library("chat_server.dart");
6 #import("chat_server_lib.dart"); 6 #import("chat_server_lib.dart");
7 7
8 8
9 final DEFAULT_PORT = 8123; 9 final DEFAULT_PORT = 8123;
10 final DEFAULT_HOST = "127.0.0.1"; 10 final DEFAULT_HOST = "127.0.0.1";
11 11
12 void main() { 12 void main() {
13 // For profiling stopping after some time is convenient. Set 13 // For profiling stopping after some time is convenient. Set
14 // stopAfter for that. 14 // stopAfter for that.
15 int stopAfter; 15 int stopAfter;
16 16
17 ServerMain serverMain = 17 ServerMain serverMain =
18 new ServerMain.start(new ChatServer(), DEFAULT_HOST, DEFAULT_PORT); 18 new ServerMain.start(new ChatServer(), DEFAULT_HOST, DEFAULT_PORT);
19 19
20 // Start a shutdown timer if requested. 20 // Start a shutdown timer if requested.
21 if (stopAfter != null) { 21 if (stopAfter != null) {
22 new Timer((timer) => serverMain.shutdown(), stopAfter * 1000, false); 22 new Timer((timer) => serverMain.shutdown(), stopAfter * 1000);
23 } 23 }
24 } 24 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698