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

# receive(as:)

Receive data from a connection as a fixed width integer.

```
func receive<Value>(as type: Value.Type) async throws -> ApplicationProtocol.Message<Value> where Value : NetworkFixedWidthInteger
```

## Parameters

`type`

The type to use when interpreting the bytes.

## Discussion

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)