<!--
{
  "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/NetworkChannel/startReceive(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Network"
    ],
    "preciseIdentifier" : "s:7Network0A7ChannelCA2A9WebSocketVRszrlE12startReceiveyyy10Foundation4DataV7content_AE8MetadataV8metadatatSi_SitYaKXEYaKXEYaKF"
  },
  "title" : "startReceive(_:)"
}
-->

# startReceive(_:)

Receive partial data from a connection.

```
func startReceive(_ handler: ((Int, Int) async throws -> ApplicationProtocol.Message<Data>) async throws -> Void) async throws
```

## Parameters

`handler`

Called immediately after invoking `startReceive`. Use
the receive closure to keep receiving partial data until the
message is complete.

## Discussion

Use this to receive large amounts of data or data that can be
processed incrementally.

This may be called before the connection is ready, in which case
the receive request will be enqueued until the connection is ready.

---

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)