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

Side by Side Diff: sdk/lib/io/websocket.dart

Issue 234323003: Make WebSocket.fromSocket public. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 8 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 | tests/standalone/io/web_socket_test.dart » ('j') | 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) 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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 /** 127 /**
128 * Create a new web socket connection. The URL supplied in [url] 128 * Create a new web socket connection. The URL supplied in [url]
129 * must use the scheme [:ws:] or [:wss:]. The [protocols] argument is 129 * must use the scheme [:ws:] or [:wss:]. The [protocols] argument is
130 * specifying the subprotocols the client is willing to speak. 130 * specifying the subprotocols the client is willing to speak.
131 */ 131 */
132 static Future<WebSocket> connect(String url, 132 static Future<WebSocket> connect(String url,
133 {List<String> protocols: const []}) => 133 {List<String> protocols: const []}) =>
134 _WebSocketImpl.connect(url, protocols); 134 _WebSocketImpl.connect(url, protocols);
135 135
136 /** 136 /**
137 * Creates a WebSocket from an existing socket.
Anders Johnsen 2014/04/29 10:43:44 [...] an already upgraded socket.
nweiz 2014/04/29 19:56:39 Done.
138 *
139 * The initial WebSocket handshake must have occurred prior to this call.
Anders Johnsen 2014/04/29 10:43:44 This comment should be expanded to include referen
nweiz 2014/04/29 19:56:39 Done.
140 * [protocol] should be the protocol negotiated by this handshake, if any.
Anders Johnsen 2014/04/29 10:43:44 protocol and serverSide should be in separate para
nweiz 2014/04/29 19:56:39 Done.
141 * [serverSide] indicates whether this is a server socket or a client socket.
142 */
143 factory WebSocket.fromSocket(Socket socket, {String protocol,
Anders Johnsen 2014/04/29 10:43:44 Please change the name to something along the line
nweiz 2014/04/29 19:56:39 Done.
144 bool serverSide: true}) =>
145 new _WebSocketImpl._fromSocket(socket, protocol, serverSide);
146
147 /**
137 * Returns the current state of the connection. 148 * Returns the current state of the connection.
138 */ 149 */
139 int get readyState; 150 int get readyState;
140 151
141 /** 152 /**
142 * The extensions property is initially the empty string. After the 153 * The extensions property is initially the empty string. After the
143 * web socket connection is established this string reflects the 154 * web socket connection is established this string reflects the
144 * extensions used by the server. 155 * extensions used by the server.
145 */ 156 */
146 String get extensions; 157 String get extensions;
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 */ 197 */
187 Future addStream(Stream stream); 198 Future addStream(Stream stream);
188 } 199 }
189 200
190 201
191 class WebSocketException implements IOException { 202 class WebSocketException implements IOException {
192 final String message; 203 final String message;
193 const WebSocketException([this.message = ""]); 204 const WebSocketException([this.message = ""]);
194 String toString() => "WebSocketException: $message"; 205 String toString() => "WebSocketException: $message";
195 } 206 }
OLDNEW
« no previous file with comments | « no previous file | tests/standalone/io/web_socket_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698