---
title: "receive(as:)"
framework: network
role: symbol
role_heading: Instance Method
path: "network/networkchannel/receive(as:)"
---

# receive(as:)

Receive data from a connection as a fixed width integer.

## Declaration

```swift
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

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