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

Side by Side Diff: tests/standalone/io/socket_bind_test.dart

Issue 2760293002: [dart:io] Adds a finalizer to _NativeSocket to avoid socket leaks (Closed)
Patch Set: Add comments. Drain Windows IO completion port in Debug Created 3 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
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 import 'dart:async'; 5 import 'dart:async';
6 import 'dart:io'; 6 import 'dart:io';
7 7
8 import 'package:async_helper/async_helper.dart'; 8 import 'package:async_helper/async_helper.dart';
9 import 'package:expect/expect.dart'; 9 import 'package:expect/expect.dart';
10 10
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 socket2.first.then((socket) async { 103 socket2.first.then((socket) async {
104 await socket.drain(); 104 await socket.drain();
105 await socket.close(); 105 await socket.close();
106 asyncEnd(); 106 asyncEnd();
107 }); 107 });
108 108
109 Socket client = await Socket.connect(host, socket2.port); 109 Socket client = await Socket.connect(host, socket2.port);
110 await client.close(); 110 await client.close();
111 await client.drain(); 111 await client.drain();
112 112
113 await socket2.close();
Cutch 2017/03/27 17:17:50 maybe a comment why you're closing this socket.
zra 2017/03/28 14:40:19 Done.
113 asyncEnd(); 114 asyncEnd();
114 } 115 }
115 116
116 main() async { 117 main() async {
117 asyncStart(); 118 asyncStart();
118 119
119 await retry(() async { 120 await retry(() async {
120 await testBindDifferentAddresses(InternetAddress.ANY_IP_V6, 121 await testBindDifferentAddresses(InternetAddress.ANY_IP_V6,
121 InternetAddress.ANY_IP_V4, 122 InternetAddress.ANY_IP_V4,
122 true, 123 true,
(...skipping 13 matching lines...) Expand all
136 negTestBindSharedMismatch(host, false); 137 negTestBindSharedMismatch(host, false);
137 negTestBindSharedMismatch(host, true); 138 negTestBindSharedMismatch(host, true);
138 139
139 negTestBindV6OnlyMismatch(host, true); 140 negTestBindV6OnlyMismatch(host, true);
140 negTestBindV6OnlyMismatch(host, false); 141 negTestBindV6OnlyMismatch(host, false);
141 142
142 testListenCloseListenClose(host); 143 testListenCloseListenClose(host);
143 } 144 }
144 asyncEnd(); 145 asyncEnd();
145 } 146 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698