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:isolate"); | 7 #import("dart:isolate"); |
8 #import("dart:json"); | 8 #import("dart:json"); |
9 #import("dart:math"); | 9 #import("dart:math"); |
10 | 10 |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 static const STARTED = 1; | 250 static const STARTED = 1; |
251 static const STOPPING = 2; | 251 static const STOPPING = 2; |
252 static const STOPPED = 3; | 252 static const STOPPED = 3; |
253 static const ERROR = 4; | 253 static const ERROR = 4; |
254 | 254 |
255 ChatServerStatus(this._state, this._message); | 255 ChatServerStatus(this._state, this._message); |
256 ChatServerStatus.starting() : _state = STARTING; | 256 ChatServerStatus.starting() : _state = STARTING; |
257 ChatServerStatus.started(this._port) : _state = STARTED; | 257 ChatServerStatus.started(this._port) : _state = STARTED; |
258 ChatServerStatus.stopping() : _state = STOPPING; | 258 ChatServerStatus.stopping() : _state = STOPPING; |
259 ChatServerStatus.stopped() : _state = STOPPED; | 259 ChatServerStatus.stopped() : _state = STOPPED; |
260 ChatServerStatus.error([this._error]) : _state = ERROR; | 260 ChatServerStatus.error2([this._error]) : _state = ERROR; |
261 | 261 |
262 bool get isStarting => _state == STARTING; | 262 bool get isStarting => _state == STARTING; |
263 bool get isStarted => _state == STARTED; | 263 bool get isStarted => _state == STARTED; |
264 bool get isStopping => _state == STOPPING; | 264 bool get isStopping => _state == STOPPING; |
265 bool get isStopped => _state == STOPPED; | 265 bool get isStopped => _state == STOPPED; |
266 bool get isError => _state == ERROR; | 266 bool get isError => _state == ERROR; |
267 | 267 |
268 int get state => _state; | 268 int get state => _state; |
269 String get message { | 269 String get message { |
270 if (_message != null) return _message; | 270 if (_message != null) return _message; |
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
684 } | 684 } |
685 } | 685 } |
686 | 686 |
687 int _timeRange; | 687 int _timeRange; |
688 List<int> _buckets; | 688 List<int> _buckets; |
689 int _currentBucket; | 689 int _currentBucket; |
690 int _currentBucketTime; | 690 int _currentBucketTime; |
691 num _bucketTimeRange; | 691 num _bucketTimeRange; |
692 int _sum; | 692 int _sum; |
693 } | 693 } |
OLD | NEW |