| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 // The following code is copied from sdk/lib/io/websocket.dart. The "dart:io" | 5 // The following code is copied from sdk/lib/io/websocket.dart. The "dart:io" |
| 6 // implementation isn't used directly to support non-"dart:io" applications. | 6 // implementation isn't used directly to support non-"dart:io" applications. |
| 7 // | 7 // |
| 8 // Because it's copied directly, only modifications necessary to support the | 8 // Because it's copied directly, only modifications necessary to support the |
| 9 // desired public API and to remove "dart:io" dependencies have been made. | 9 // desired public API and to remove "dart:io" dependencies have been made. |
| 10 // | 10 // |
| 11 // This is up-to-date as of sdk revision | 11 // This is up-to-date as of sdk revision |
| 12 // 86227840d75d974feb238f8b3c59c038b99c05cf. | 12 // 86227840d75d974feb238f8b3c59c038b99c05cf. |
| 13 library http_parser.copy.web_socket; | |
| 14 | |
| 15 /** | 13 /** |
| 16 * Web socket status codes used when closing a web socket connection. | 14 * Web socket status codes used when closing a web socket connection. |
| 17 */ | 15 */ |
| 18 abstract class WebSocketStatus { | 16 abstract class WebSocketStatus { |
| 19 static const int NORMAL_CLOSURE = 1000; | 17 static const int NORMAL_CLOSURE = 1000; |
| 20 static const int GOING_AWAY = 1001; | 18 static const int GOING_AWAY = 1001; |
| 21 static const int PROTOCOL_ERROR = 1002; | 19 static const int PROTOCOL_ERROR = 1002; |
| 22 static const int UNSUPPORTED_DATA = 1003; | 20 static const int UNSUPPORTED_DATA = 1003; |
| 23 static const int RESERVED_1004 = 1004; | 21 static const int RESERVED_1004 = 1004; |
| 24 static const int NO_STATUS_RECEIVED = 1005; | 22 static const int NO_STATUS_RECEIVED = 1005; |
| 25 static const int ABNORMAL_CLOSURE = 1006; | 23 static const int ABNORMAL_CLOSURE = 1006; |
| 26 static const int INVALID_FRAME_PAYLOAD_DATA = 1007; | 24 static const int INVALID_FRAME_PAYLOAD_DATA = 1007; |
| 27 static const int POLICY_VIOLATION = 1008; | 25 static const int POLICY_VIOLATION = 1008; |
| 28 static const int MESSAGE_TOO_BIG = 1009; | 26 static const int MESSAGE_TOO_BIG = 1009; |
| 29 static const int MISSING_MANDATORY_EXTENSION = 1010; | 27 static const int MISSING_MANDATORY_EXTENSION = 1010; |
| 30 static const int INTERNAL_SERVER_ERROR = 1011; | 28 static const int INTERNAL_SERVER_ERROR = 1011; |
| 31 static const int RESERVED_1015 = 1015; | 29 static const int RESERVED_1015 = 1015; |
| 32 } | 30 } |
| 33 | 31 |
| 34 abstract class WebSocket { | 32 abstract class WebSocket { |
| 35 /** | 33 /** |
| 36 * Possible states of the connection. | 34 * Possible states of the connection. |
| 37 */ | 35 */ |
| 38 static const int CONNECTING = 0; | 36 static const int CONNECTING = 0; |
| 39 static const int OPEN = 1; | 37 static const int OPEN = 1; |
| 40 static const int CLOSING = 2; | 38 static const int CLOSING = 2; |
| 41 static const int CLOSED = 3; | 39 static const int CLOSED = 3; |
| 42 } | 40 } |
| OLD | NEW |