---
title: nw_connection_receive_completion_t
framework: network
role: symbol
role_heading: Type Alias
path: network/nw_connection_receive_completion_t
---

# nw_connection_receive_completion_t

A completion handler that indicates when content has been received by the connection, or that an error was encountered.

## Declaration

```swift
typealias nw_connection_receive_completion_t = (dispatch_data_t?, nw_content_context_t?, Bool, nw_error_t?) -> Void
```

## Parameters

- `content`: The received content, as constrained by the minimum and maximum length. This may be nil if the message or stream is complete (without any more data to deliver), or if an error was encountered.
- `context`: Content context describing the received content. This includes protocol metadata that lets the caller introspect information about the received content (such as flags on a packet).
- `is_complete`: An indication that this context (a message or stream, for example) is now complete. For protocols such as TCP, this will be marked when the entire stream has be closed in the reading direction. For protocols such as UDP, this will be marked when the end of a datagram has been reached.
- `error`: An error will be sent if the receive was terminated before completing. There may still be content delivered along with the error, but this content may be shorter than the requested ranges. An error will be sent for any outstanding receives when the connection is cancelled.

## See Also

### Data Types

- [nw_advertise_descriptor_t](network/nw_advertise_descriptor_t.md)
- [nw_browse_descriptor_t](network/nw_browse_descriptor_t.md)
- [nw_browse_result_change_t](network/nw_browse_result_change_t.md)
- [nw_browse_result_enumerate_interface_t](network/nw_browse_result_enumerate_interface_t.md)
- [nw_browse_result_t](network/nw_browse_result_t.md)
- [nw_browser_browse_results_changed_handler_t](network/nw_browser_browse_results_changed_handler_t.md)
- [nw_browser_state_changed_handler_t](network/nw_browser_state_changed_handler_t.md)
- [nw_browser_t](network/nw_browser_t.md)
- [nw_connection_boolean_event_handler_t](network/nw_connection_boolean_event_handler_t.md)
- [nw_connection_group_new_connection_handler_t](network/nw_connection_group_new_connection_handler_t.md)
- [nw_connection_group_receive_handler_t](network/nw_connection_group_receive_handler_t.md)
- [nw_connection_group_send_completion_t](network/nw_connection_group_send_completion_t.md)
- [nw_connection_group_state_changed_handler_t](network/nw_connection_group_state_changed_handler_t.md)
- [nw_connection_group_t](network/nw_connection_group_t.md)
- [nw_connection_path_event_handler_t](network/nw_connection_path_event_handler_t.md)
