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

# receive(exactly:)

Receive data from a connection.

## Declaration

```swift
func receive(exactly: Int) async throws -> ApplicationProtocol.Message<Data>
```

## Parameters

- `exactly`: Receive exactly this number of bytes from the connection.

## 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.
