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

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

Issue 12610006: Renamed StreamSink to EventSink. Renamed signalError to addError. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Changed inheritance back! Now create StreamSink instead of EventSink where we create them. Created 7 years, 9 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
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 part of dart.io; 5 part of dart.io;
6 6
7 /** 7 /**
8 * The [SecureServerSocket] is a server socket, providing a stream of high-level 8 * The [SecureServerSocket] is a server socket, providing a stream of high-level
9 * [Socket]s. 9 * [Socket]s.
10 * 10 *
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 .then((RawSecureSocket secureConnection) { 191 .then((RawSecureSocket secureConnection) {
192 if (_closed) { 192 if (_closed) {
193 secureConnection.close(); 193 secureConnection.close();
194 } else { 194 } else {
195 _controller.add(secureConnection); 195 _controller.add(secureConnection);
196 } 196 }
197 }).catchError((e) { 197 }).catchError((e) {
198 if (_closed) { 198 if (_closed) {
199 throw e; 199 throw e;
200 } else { 200 } else {
201 _controller.signalError(e); 201 _controller.addError(e);
202 close(); 202 close();
203 } 203 }
204 }); 204 });
205 } 205 }
206 206
207 void _onError(e) { 207 void _onError(e) {
208 _controller.signalError(e); 208 _controller.addError(e);
209 close(); 209 close();
210 } 210 }
211 211
212 void _onDone() { 212 void _onDone() {
213 _controller.close(); 213 _controller.close();
214 } 214 }
215 215
216 void _onPauseStateChange() { 216 void _onPauseStateChange() {
217 if (_controller.isPaused) { 217 if (_controller.isPaused) {
218 _subscription.pause(); 218 _subscription.pause();
219 } else { 219 } else {
220 _subscription.resume(); 220 _subscription.resume();
221 } 221 }
222 } 222 }
223 223
224 void _onSubscriptionStateChange() { 224 void _onSubscriptionStateChange() {
225 if (_controller.hasSubscribers) { 225 if (_controller.hasSubscribers) {
226 _subscription = _socket.listen(_onData, 226 _subscription = _socket.listen(_onData,
227 onDone: _onDone, 227 onDone: _onDone,
228 onError: _onError); 228 onError: _onError);
229 } else { 229 } else {
230 close(); 230 close();
231 } 231 }
232 } 232 }
233 } 233 }
234 234
235 235
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698