<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: 26.0.0 -",
    "macOS: 26.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: 26.0.0 -",
    "watchOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Network",
  "identifier" : "/documentation/Network/NetworkConnection/inboundStreams(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Network"
    ],
    "preciseIdentifier" : "s:7Network0A10ConnectionCA2A4QUICVRszrlE14inboundStreamsyyyAE6StreamCy_AA10QUICStreamVGYaYbKYAcYaKF"
  },
  "title" : "inboundStreams(_:)"
}
-->

# inboundStreams(_:)

Handle inbound streams and provide a closure on which callback handlers will be executed.
When the `NetworkConnection<QUIC>` state moves to `ready`, the internal listener is registered with the system
and can receive incoming streams on the multiplexing instance.
`inboundStreams` should only be called once on a `NetworkConnection<QUIC>`, and multiple calls to run will
throw an exception.

```
final func inboundStreams(_ handler: @escaping @isolated(any) @Sendable (QUIC.Stream<QUICStream>) async throws -> Void) async throws
```

## Discussion

If the `NetworkConnection<QUIC>` is not started at the time that `inboundStreams` is invoked, it will be started.

The closure inherits the isolation domain of the caller.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)