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

Unified Diff: runtime/bin/socket_impl.dart

Issue 8498009: Fix hang when opening sockets on ports that are not available. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 9 years, 1 month 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 | tests/standalone/src/TimeoutTest.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/socket_impl.dart
diff --git a/runtime/bin/socket_impl.dart b/runtime/bin/socket_impl.dart
index 97c3e5e63fe6a2f994dfb98fee6a1921a6e63f97..10cc29585c4ce6cd50c5ae4642ddd08475c4c6ed 100644
--- a/runtime/bin/socket_impl.dart
+++ b/runtime/bin/socket_impl.dart
@@ -201,6 +201,7 @@ class _ServerSocket extends _SocketBase implements ServerSocket {
factory _ServerSocket(String bindAddress, int port, int backlog) {
ServerSocket socket = new _ServerSocket._internal();
if (!socket._createBindListen(bindAddress, port, backlog)) {
+ socket.close();
return null;
}
if (port != 0) {
@@ -247,6 +248,7 @@ class _Socket extends _SocketBase implements Socket {
factory _Socket(String host, int port) {
Socket socket = new _Socket._internal();
if (!socket._createConnect(host, port)) {
+ socket.close();
return null;
}
return socket;
« no previous file with comments | « no previous file | tests/standalone/src/TimeoutTest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698