Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(399)

Unified Diff: sdk/lib/io/websocket.dart

Issue 19970004: Add ability to send a ping interval on a WebSocket. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add pingInterval test for server-side and add close-check when sending Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | sdk/lib/io/websocket_impl.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/io/websocket.dart
diff --git a/sdk/lib/io/websocket.dart b/sdk/lib/io/websocket.dart
index 370d694f0b04de4d0a50b0a89cb9f5241298d8d0..b67f89e3b3ab20f10b53c5cb638141bc22bf31f3 100644
--- a/sdk/lib/io/websocket.dart
+++ b/sdk/lib/io/websocket.dart
@@ -131,6 +131,22 @@ abstract class WebSocket implements Stream, StreamSink {
String get closeReason;
/**
+ * Set and get the interval for sending ping signals. If a ping message is not
+ * answered by a pong message from the peer, the `WebSocket` is assumed
+ * disconnected and the connection is closed with a
+ * [WebSocketStatus.GOING_AWAY] close code. When a ping signal is sent, the
+ * pong message must be received within [pingInterval].
+ *
+ * There are never two outstanding pings at any given time, and the next ping
+ * timer starts when the pong is received.
+ *
+ * Set the [pingInterval] to `null` to disable sending ping messages.
+ *
+ * The default value is `null`.
+ */
+ Duration pingInterval;
+
+ /**
* Closes the web socket connection. Set the optional [code] and [reason]
* arguments to send close information to the remote peer. If they are
* omitted, the peer will see [WebSocketStatus.NO_STATUS_RECEIVED] code
« no previous file with comments | « no previous file | sdk/lib/io/websocket_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698