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 /** | 5 /** |
6 * Web socket status codes used when closing a web socket connection. | 6 * Web socket status codes used when closing a web socket connection. |
7 */ | 7 */ |
8 abstract class WebSocketStatus { | 8 abstract class WebSocketStatus { |
9 static const int NORMAL_CLOSURE = 1000; | 9 static const int NORMAL_CLOSURE = 1000; |
10 static const int GOING_AWAY = 1001; | 10 static const int GOING_AWAY = 1001; |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 | 86 |
87 /** | 87 /** |
88 * Close the web socket connection. The default value for [status] | 88 * Close the web socket connection. The default value for [status] |
89 * and [reason] are [:null:]. | 89 * and [reason] are [:null:]. |
90 */ | 90 */ |
91 close([int status, String reason]); | 91 close([int status, String reason]); |
92 | 92 |
93 /** | 93 /** |
94 * WebSocketConnection is hashable. | 94 * WebSocketConnection is hashable. |
95 */ | 95 */ |
96 int hashCode(); | 96 int get hashCode; |
97 } | 97 } |
98 | 98 |
99 | 99 |
100 /** | 100 /** |
101 * Client web socket connection. | 101 * Client web socket connection. |
102 */ | 102 */ |
103 abstract class WebSocketClientConnection { | 103 abstract class WebSocketClientConnection { |
104 /** | 104 /** |
105 * Creates a new web socket client connection based on a HTTP client | 105 * Creates a new web socket client connection based on a HTTP client |
106 * connection. The HTTP client connection must be freshly opened. | 106 * connection. The HTTP client connection must be freshly opened. |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 | 159 |
160 /** | 160 /** |
161 * Close the web socket connection. The default value for [status] | 161 * Close the web socket connection. The default value for [status] |
162 * and [reason] are [:null:]. | 162 * and [reason] are [:null:]. |
163 */ | 163 */ |
164 close([int status, String reason]); | 164 close([int status, String reason]); |
165 | 165 |
166 /** | 166 /** |
167 * WebSocketClientConnection is hashable. | 167 * WebSocketClientConnection is hashable. |
168 */ | 168 */ |
169 int hashCode(); | 169 int get hashCode; |
170 } | 170 } |
171 | 171 |
172 | 172 |
173 /** | 173 /** |
174 * Base class for the events generated by the W3C complient browser | 174 * Base class for the events generated by the W3C complient browser |
175 * API for web sockets. | 175 * API for web sockets. |
176 */ | 176 */ |
177 abstract class Event { } | 177 abstract class Event { } |
178 | 178 |
179 /** | 179 /** |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 */ | 294 */ |
295 void send(data); | 295 void send(data); |
296 } | 296 } |
297 | 297 |
298 | 298 |
299 class WebSocketException implements Exception { | 299 class WebSocketException implements Exception { |
300 const WebSocketException([String this.message = ""]); | 300 const WebSocketException([String this.message = ""]); |
301 String toString() => "WebSocketException: $message"; | 301 String toString() => "WebSocketException: $message"; |
302 final String message; | 302 final String message; |
303 } | 303 } |
OLD | NEW |