Document that IPv4 are preferred in socket.connect.

Bug: https://github.com/dart-lang/sdk/issues/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>
This commit is contained in:
Brian Quinlan 2023-04-03 23:48:13 +00:00 committed by Commit Queue
parent 525376cc88
commit 17ea08c10c
2 changed files with 11 additions and 4 deletions

View file

@ -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

View file

@ -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