| OLD | NEW |
| 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 } |
| OLD | NEW |