Contents

startReceive(_:)

Receive partial data from a connection.

Declaration

func startReceive(_ handler: ((Int, Int) async throws -> ApplicationProtocol.Message<Data>) async throws -> Void) async throws

Parameters

  • handler:

    Called immediately after invoking startReceive. Use the receive closure to keep receiving partial data until the message is complete.

Discussion

Use this to receive large amounts of data or data that can be processed incrementally.

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