Skip to content

Commit

Permalink
Document that IPv4 are preferred in socket.connect.
Browse files Browse the repository at this point in the history
Bug: #50868
Change-Id: I8186d95d1a24c77c4cfade533af26695c7a13b24
CoreLibraryReviewExempt: documentation-only change
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/293020
Commit-Queue: Brian Quinlan <bquinlan@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
  • Loading branch information
brianquinlan authored and Commit Queue committed Apr 3, 2023
1 parent 525376c commit 17ea08c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Expand Up @@ -172,14 +172,20 @@

#### `dart:io`

- Deprecated `NetworkInterface.listSupported`. Has always returned true since
- Deprecate `NetworkInterface.listSupported`. Has always returned true since
Dart 2.3.
- Finalize `httpEnableTimelineLogging` parameter name transition from `enable`
to `enabled`. See [#43638][].
- Favor IPv4 connections over IPv6 when connecting sockets. See
[#50868].
- **Breaking change** [#51035][]:
- Update `NetworkProfiling` to accommodate new `String` ids
that are introduced in vm_service:11.0.0

[#43638]: https://github.com/dart-lang/sdk/issues/43638
[#50868]: https://github.com/dart-lang/sdk/issues/50868
[#51035]: https://github.com/dart-lang/sdk/issues/51035

#### `dart:js_util`

- Added several helper functions to access more JavaScript operator, like
Expand Down
7 changes: 4 additions & 3 deletions sdk/lib/io/socket.dart
Expand Up @@ -549,9 +549,10 @@ abstract class RawSocket implements Stream<RawSocketEvent> {
///
/// The [host] can either be a [String] or an [InternetAddress]. If [host] is a
/// [String], [connect] will perform a [InternetAddress.lookup] and try
/// all returned [InternetAddress]es, until connected. Unless a
/// connection was established, the error from the first failing connection is
/// returned.
/// all returned [InternetAddress]es, until connected. If IPv4 and IPv6
/// addresses are both availble then connections over IPv4 are preferred. If
/// no connection can be establed then the error from the first failing
/// connection is returned.
///
/// The argument [sourceAddress] can be used to specify the local
/// address to bind when making the connection. The [sourceAddress] can either
Expand Down

0 comments on commit 17ea08c

Please sign in to comment.