OLD | NEW |
(Empty) | |
| 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 |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 |
| 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. |
| 7 // |
| 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. |
| 10 // |
| 11 // This is up-to-date as of sdk revision |
| 12 // 86227840d75d974feb238f8b3c59c038b99c05cf. |
| 13 library http_parser.copy.web_socket; |
| 14 |
| 15 /** |
| 16 * Web socket status codes used when closing a web socket connection. |
| 17 */ |
| 18 abstract class WebSocketStatus { |
| 19 static const int NORMAL_CLOSURE = 1000; |
| 20 static const int GOING_AWAY = 1001; |
| 21 static const int PROTOCOL_ERROR = 1002; |
| 22 static const int UNSUPPORTED_DATA = 1003; |
| 23 static const int RESERVED_1004 = 1004; |
| 24 static const int NO_STATUS_RECEIVED = 1005; |
| 25 static const int ABNORMAL_CLOSURE = 1006; |
| 26 static const int INVALID_FRAME_PAYLOAD_DATA = 1007; |
| 27 static const int POLICY_VIOLATION = 1008; |
| 28 static const int MESSAGE_TOO_BIG = 1009; |
| 29 static const int MISSING_MANDATORY_EXTENSION = 1010; |
| 30 static const int INTERNAL_SERVER_ERROR = 1011; |
| 31 static const int RESERVED_1015 = 1015; |
| 32 } |
| 33 |
| 34 abstract class WebSocket { |
| 35 /** |
| 36 * Possible states of the connection. |
| 37 */ |
| 38 static const int CONNECTING = 0; |
| 39 static const int OPEN = 1; |
| 40 static const int CLOSING = 2; |
| 41 static const int CLOSED = 3; |
| 42 } |
OLD | NEW |