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

Side by Side Diff: runtime/bin/websocket.dart

Issue 10535168: specify which version of web sockets (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: clarify Created 8 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 * The web socket protocol is implemented by a HTTP server handler 6 * The web socket protocol is implemented by a HTTP server handler
7 * which can be instantiated like this: 7 * which can be instantiated like this:
8 * 8 *
9 * WebSocketHandler wsHandler = new WebSocketHandler(); 9 * WebSocketHandler wsHandler = new WebSocketHandler();
10 * 10 *
11 * and then its onRequest method can be assigned to the HTTP server, e.g. 11 * and then its onRequest method can be assigned to the HTTP server, e.g.
12 * 12 *
13 * server.defaultHandler = wsHandler.onRequest; 13 * server.defaultHandler = wsHandler.onRequest;
14 * 14 *
15 * or 15 * or
16 * 16 *
17 * server.addRequestHandler((req) => req.path == "/ws", 17 * server.addRequestHandler((req) => req.path == "/ws",
18 * wsHandler.onRequest); 18 * wsHandler.onRequest);
19 *
20 * This handler strives to implement web sockets as specified by RFC6455.
19 */ 21 */
20 interface WebSocketHandler default _WebSocketHandler { 22 interface WebSocketHandler default _WebSocketHandler {
21 WebSocketHandler(); 23 WebSocketHandler();
22 24
23 /** 25 /**
24 * Request handler to be registered with the HTTP server. 26 * Request handler to be registered with the HTTP server.
25 */ 27 */
26 void onRequest(HttpRequest request, HttpResponse response); 28 void onRequest(HttpRequest request, HttpResponse response);
27 29
28 /** 30 /**
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 */ 278 */
277 void send(data); 279 void send(data);
278 } 280 }
279 281
280 282
281 class WebSocketException implements Exception { 283 class WebSocketException implements Exception {
282 const WebSocketException([String this.message = ""]); 284 const WebSocketException([String this.message = ""]);
283 String toString() => "WebSocketException: $message"; 285 String toString() => "WebSocketException: $message";
284 final String message; 286 final String message;
285 } 287 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698