Function

nw_connection_receive

Schedules a single receive completion handler, with a range indicating how many bytes the handler can receive at one time.

Declaration

void nw_connection_receive(nw_connection_t connection, uint32_t minimum_incomplete_length, uint32_t maximum_length, nw_connection_receive_completion_t completion);

Parameters

minimum_incomplete_length

The minimum length to receive from the connection, until the content is complete.

maximum_length

The maximum length to receive from the connection in a single completion.

completion

A receive completion is invoked exactly once for a call to receive. The completion indicates that the requested content has been received (in which case the content is delivered), or else an error has occurred.

The completion delivers the received content, which may be nil if the message is complete or an error occurred, the message context, a flag indicating if the message is complete, and any associated error.

See Also

Sending and Receiving Data

nw_connection_send

Sends data on a connection.

nw_connection_send_completion_t

A completion handler that indicates when the connection has finished processing sent content.

nw_content_context_t

A representation of a message to send or receive, containing protocol metadata and send properties.

nw_connection_receive_completion_t

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

nw_connection_receive_message

Schedules a single receive completion handler for a complete message, as opposed to a range of bytes.

nw_connection_batch

Defines a block in which calls to send and receive are processed as a batch to improve performance.

nw_connection_get_maximum_datagram_size

Accesses the maximum size of a datagram message that can be sent on a connection.