Repository: flutter
Issue: Intermittent hot restart errors on iOS 16 / macOS Ventura
Labels: platform-ios,a: tablet,dependency: dart,t: hot reload,e: OS-version specific,P2,team-ios,triaged-ios

## Steps to Reproduce

Occasionally while debugging on iOS 16 Beta 1 / macOS Ventura using VSCode, hot restarts stall with a lot of these messages in the log:

```
ERROR - 2022-06-07 12:03:30.459864
PUT /JAsRhrxCVXE=/
Error thrown by handler.
SocketException: Write failed (OS Error: Broken pipe, errno = 32), address = 127.0.0.1, port = 63811
dart:isolate  _RawReceivePortImpl._handleMessage


ERROR - 2022-06-07 12:03:31.227363
PUT /JAsRhrxCVXE=/
Error thrown by handler.
SocketException: Connection reset by peer (OS Error: Connection reset by peer, errno = 54), address = 127.0.0.1, port = 63815

ERROR - 2022-06-07 12:03:31.774987
PUT /JAsRhrxCVXE=/
Error thrown by handler.
SocketException: Write failed (OS Error: Broken pipe, errno = 32), address = 127.0.0.1, port = 63820
dart:isolate  _RawReceivePortImpl._handleMessage


ERROR - 2022-06-07 12:03:32.511095
PUT /JAsRhrxCVXE=/
Error thrown by handler.
SocketException: Connection reset by peer (OS Error: Connection reset by peer, errno = 54), address = 127.0.0.1, port = 63822
```

Sometimes hot restart completes successfully, sometimes it doesn't.

## Logs

<details>
<summary>Logs</summary>

<!--
      Include the full logs of the commands you are running between the lines
      with the backticks below. If you are running any "flutter" commands,
      please include the output of running them with "--verbose"; for example,
      the output of running "flutter --verbose create foo".
-->

```
```

<!-- If possible, paste the output of running `flutter doctor -v` here. -->

```
[✓] Flutter (Channel stable, 3.0.1, on macOS 13.0 22A5266r darwin-arm, locale en-US)
    • Flutter version 3.0.1 at /Users/james/Development/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision fb57da5f94 (3 weeks ago), 2022-05-19 15:50:29 -0700
    • Engine revision caaafc5604
    • Dart version 2.17.1
    • DevTools version 2.12.2

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /Users/james/Library/Android/sdk
    • Platform android-31, build-tools 31.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7772763)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.0)
    • Xcode at /Applications/Xcode-beta.app/Contents/Developer
    • CocoaPods version 1.11.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7772763)

[✓] VS Code (version 1.67.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.40.0

[✓] Connected device (3 available)
    • Apollo (mobile) • 00008110-0004752E3AB8801E • ios            • iOS 16.0 20A5283p
    • macOS (desktop) • macos                     • darwin-arm64   • macOS 13.0 22A5266r darwin-arm
    • Chrome (web)    • chrome                    • web-javascript • Google Chrome 102.0.5005.61
    ! Error: James’s Apple Watch does not have Developer Mode enabled. Developer Mode needs to be enabled on this device in Settings → Privacy & Security
      before it can be used. (code 6)

[✓] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!
```

</details>