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

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

Issue 25276003: Don't emit errors from the socket when we are closing it down. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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/standalone.status » ('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 patch class RawServerSocket { 5 patch class RawServerSocket {
6 /* patch */ static Future<RawServerSocket> bind(address, 6 /* patch */ static Future<RawServerSocket> bind(address,
7 int port, 7 int port,
8 {int backlog: 0, 8 {int backlog: 0,
9 bool v6Only: false}) { 9 bool v6Only: false}) {
10 return _RawServerSocket.bind(address, port, backlog, v6Only); 10 return _RawServerSocket.bind(address, port, backlog, v6Only);
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after
477 } 477 }
478 478
479 // Don't call the in handler if there is no data available 479 // Don't call the in handler if there is no data available
480 // after all. 480 // after all.
481 if (i == READ_EVENT && 481 if (i == READ_EVENT &&
482 typeFlags != TYPE_LISTENING_SOCKET && 482 typeFlags != TYPE_LISTENING_SOCKET &&
483 available() == 0) { 483 available() == 0) {
484 continue; 484 continue;
485 } 485 }
486 if (i == ERROR_EVENT) { 486 if (i == ERROR_EVENT) {
487 reportError(nativeGetError(), ""); 487 if (!isClosing) {
488 reportError(nativeGetError(), "");
489 }
488 } else if (!isClosed) { 490 } else if (!isClosed) {
489 // If the connection is closed right after it's accepted, there's a 491 // If the connection is closed right after it's accepted, there's a
490 // chance the close-handler is not set. 492 // chance the close-handler is not set.
491 if (handler != null) handler(); 493 if (handler != null) handler();
492 } 494 }
493 } 495 }
494 } 496 }
495 if (isClosedRead && isClosedWrite) close(); 497 if (isClosedRead && isClosedWrite) close();
496 canActivateEvents = true; 498 canActivateEvents = true;
497 activateHandlers(); 499 activateHandlers();
(...skipping 715 matching lines...) Expand 10 before | Expand all | Expand 10 after
1213 if (_detachReady != null) { 1215 if (_detachReady != null) {
1214 _detachReady.complete(null); 1216 _detachReady.complete(null);
1215 } else { 1217 } else {
1216 if (_raw != null) { 1218 if (_raw != null) {
1217 _raw.shutdown(SocketDirection.SEND); 1219 _raw.shutdown(SocketDirection.SEND);
1218 _disableWriteEvent(); 1220 _disableWriteEvent();
1219 } 1221 }
1220 } 1222 }
1221 } 1223 }
1222 } 1224 }
OLDNEW
« no previous file with comments | « no previous file | tests/standalone/standalone.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698