Index: samples/chat/chat_server.dart |
diff --git a/samples/chat/chat_server.dart b/samples/chat/chat_server.dart |
index 537068b14bef9b983f0be6e8104e3e041f2d093f..c581538a99b56af8ee00a9e073a71050f7e6425e 100644 |
--- a/samples/chat/chat_server.dart |
+++ b/samples/chat/chat_server.dart |
@@ -16,12 +16,13 @@ void main() { |
// stopAfter for that. |
int stopAfter; |
- var serverPort = spawnFunction(startChatServer); |
- ServerMain serverMain = |
- new ServerMain.start(serverPort, DEFAULT_HOST, DEFAULT_PORT); |
+ spawnChatServer().then((serverPort) { |
+ ServerMain serverMain = |
+ new ServerMain.start(serverPort, DEFAULT_HOST, DEFAULT_PORT); |
- // Start a shutdown timer if requested. |
- if (stopAfter != null) { |
- new Timer(new Duration(seconds: stopAfter), serverMain.shutdown); |
- } |
+ // Start a shutdown timer if requested. |
+ if (stopAfter != null) { |
+ new Timer(new Duration(seconds: stopAfter), serverMain.shutdown); |
+ } |
+ }); |
} |