| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 part of dart.io; | 5 part of dart.io; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * Web socket status codes used when closing a web socket connection. | 8 * Web socket status codes used when closing a web socket connection. |
| 9 */ | 9 */ |
| 10 abstract class WebSocketStatus { | 10 abstract class WebSocketStatus { |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 String get closeReason; | 131 String get closeReason; |
| 132 | 132 |
| 133 /** | 133 /** |
| 134 * Set and get the interval for sending ping signals. If a ping message is not | 134 * Set and get the interval for sending ping signals. If a ping message is not |
| 135 * answered by a pong message from the peer, the `WebSocket` is assumed | 135 * answered by a pong message from the peer, the `WebSocket` is assumed |
| 136 * disconnected and the connection is closed with a | 136 * disconnected and the connection is closed with a |
| 137 * [WebSocketStatus.GOING_AWAY] close code. When a ping signal is sent, the | 137 * [WebSocketStatus.GOING_AWAY] close code. When a ping signal is sent, the |
| 138 * pong message must be received within [pingInterval]. | 138 * pong message must be received within [pingInterval]. |
| 139 * | 139 * |
| 140 * There are never two outstanding pings at any given time, and the next ping | 140 * There are never two outstanding pings at any given time, and the next ping |
| 141 * timer starts when either data or a pong message is received. | 141 * timer starts when the pong is received. |
| 142 * | 142 * |
| 143 * Set the [pingInterval] to `null` to disable sending ping messages. | 143 * Set the [pingInterval] to `null` to disable sending ping messages. |
| 144 * | 144 * |
| 145 * The default value is `null`. | 145 * The default value is `null`. |
| 146 */ | 146 */ |
| 147 Duration pingInterval; | 147 Duration pingInterval; |
| 148 | 148 |
| 149 /** | 149 /** |
| 150 * Closes the web socket connection. Set the optional [code] and [reason] | 150 * Closes the web socket connection. Set the optional [code] and [reason] |
| 151 * arguments to send close information to the remote peer. If they are | 151 * arguments to send close information to the remote peer. If they are |
| (...skipping 15 matching lines...) Expand all Loading... |
| 167 */ | 167 */ |
| 168 Future addStream(Stream stream); | 168 Future addStream(Stream stream); |
| 169 } | 169 } |
| 170 | 170 |
| 171 | 171 |
| 172 class WebSocketException implements IOException { | 172 class WebSocketException implements IOException { |
| 173 const WebSocketException([String this.message = ""]); | 173 const WebSocketException([String this.message = ""]); |
| 174 String toString() => "WebSocketException: $message"; | 174 String toString() => "WebSocketException: $message"; |
| 175 final String message; | 175 final String message; |
| 176 } | 176 } |
| OLD | NEW |