OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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"); | 5 #library("chat_server"); |
6 #import("dart:io"); | 6 #import("dart:io"); |
7 #import("dart:json"); | 7 #import("dart:json"); |
| 8 #import("dart:isolate"); |
8 #import("http.dart"); | 9 #import("http.dart"); |
9 | 10 |
10 typedef void RequestHandler(HTTPRequest request, HTTPResponse response); | 11 typedef void RequestHandler(HTTPRequest request, HTTPResponse response); |
11 | 12 |
12 class ChatServer extends IsolatedServer { | 13 class ChatServer extends IsolatedServer { |
13 ChatServer() : super() { | 14 ChatServer() : super() { |
14 addHandler("/", | 15 addHandler("/", |
15 (HTTPRequest request, HTTPResponse response) => | 16 (HTTPRequest request, HTTPResponse response) => |
16 redirectPageHandler( | 17 redirectPageHandler( |
17 request, response, "dart_client/index.html")); | 18 request, response, "dart_client/index.html")); |
(...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
708 } | 709 } |
709 } | 710 } |
710 | 711 |
711 int _timeRange; | 712 int _timeRange; |
712 List<int> _buckets; | 713 List<int> _buckets; |
713 int _currentBucket; | 714 int _currentBucket; |
714 int _currentBucketTime; | 715 int _currentBucketTime; |
715 num _bucketTimeRange; | 716 num _bucketTimeRange; |
716 int _sum; | 717 int _sum; |
717 } | 718 } |
OLD | NEW |