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

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

Issue 25511002: Add reusePort argument to ServerSocket. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Mac os X version. 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 | « runtime/bin/socket_win.cc ('k') | tests/standalone/io/socket_reuse_port_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 /** 8 /**
9 * [InternetAddressType] is the type an [InternetAddress]. Currently, 9 * [InternetAddressType] is the type an [InternetAddress]. Currently,
10 * IP version 4 (IPv4) and IP version 6 (IPv6) are supported. 10 * IP version 4 (IPv4) and IP version 6 (IPv6) are supported.
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 * using the [:port:] getter. 187 * using the [:port:] getter.
188 * 188 *
189 * The optional argument [backlog] can be used to specify the listen 189 * The optional argument [backlog] can be used to specify the listen
190 * backlog for the underlying OS listen setup. If [backlog] has the 190 * backlog for the underlying OS listen setup. If [backlog] has the
191 * value of [:0:] (the default) a reasonable value will be chosen by 191 * value of [:0:] (the default) a reasonable value will be chosen by
192 * the system. 192 * the system.
193 */ 193 */
194 external static Future<RawServerSocket> bind(address, 194 external static Future<RawServerSocket> bind(address,
195 int port, 195 int port,
196 {int backlog: 0, 196 {int backlog: 0,
197 bool v6Only: false}); 197 bool v6Only: false,
198 bool reusePort: false});
198 199
199 /** 200 /**
200 * Returns the port used by this socket. 201 * Returns the port used by this socket.
201 */ 202 */
202 int get port; 203 int get port;
203 204
204 /** 205 /**
205 * Returns the address used by this socket. 206 * Returns the address used by this socket.
206 */ 207 */
207 InternetAddress get address; 208 InternetAddress get address;
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 * [port] getter. 249 * [port] getter.
249 * 250 *
250 * The optional argument [backlog] can be used to specify the listen 251 * The optional argument [backlog] can be used to specify the listen
251 * backlog for the underlying OS listen setup. If [backlog] has the 252 * backlog for the underlying OS listen setup. If [backlog] has the
252 * value of [:0:] (the default) a reasonable value will be chosen by 253 * value of [:0:] (the default) a reasonable value will be chosen by
253 * the system. 254 * the system.
254 */ 255 */
255 external static Future<ServerSocket> bind(address, 256 external static Future<ServerSocket> bind(address,
256 int port, 257 int port,
257 {int backlog: 0, 258 {int backlog: 0,
258 bool v6Only: false}); 259 bool v6Only: false,
260 bool reusePort: false});
259 261
260 /** 262 /**
261 * Returns the port used by this socket. 263 * Returns the port used by this socket.
262 */ 264 */
263 int get port; 265 int get port;
264 266
265 /** 267 /**
266 * Returns the address used by this socket. 268 * Returns the address used by this socket.
267 */ 269 */
268 InternetAddress get address; 270 InternetAddress get address;
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
512 } else { 514 } else {
513 sb.write(", address = ${address.address}"); 515 sb.write(", address = ${address.address}");
514 } 516 }
515 } 517 }
516 if (port != null) { 518 if (port != null) {
517 sb.write(", port = $port"); 519 sb.write(", port = $port");
518 } 520 }
519 return sb.toString(); 521 return sb.toString();
520 } 522 }
521 } 523 }
OLDNEW
« no previous file with comments | « runtime/bin/socket_win.cc ('k') | tests/standalone/io/socket_reuse_port_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698