Type Alias

nw_framer_parse_completion_t

A handler that examines a range of data being sent or received.

Declaration

typedef size_t (^nw_framer_parse_completion_t)(uint8_t *buffer, size_t buffer_length, bool is_complete);

Parameters

buffer

The pointer to bytes to parse.

buffer_length

The length of the buffer.

is_complete

A boolean indicating if this span of bytes represents the end of a message.

Return Value

Return the number of bytes by which to increment the input or output cursor. Once the cursor is moved, previous bytes will no longer be delivered to nw_framer_parse_input and nw_framer_deliver_input_no_copy for input data, or nw_framer_parse_output and nw_framer_write_output_no_copy for output messages.

See Also

Handling Input Data

nw_framer_set_input_handler

Sets a block to handle new inbound data.

nw_framer_input_handler_t

A handler that notifies your protocol that new inbound data is available to parse.

nw_framer_parse_input

Examines the content of input data while inside your input handler block.

nw_framer_deliver_input

Delivers an inbound message containing arbitrary data from your protocol to the application.

nw_framer_deliver_input_no_copy

Delivers an inbound message containing a specific number of next received bytes.

nw_framer_pass_through_input

Indicates that your protocol no longer needs to handle input data.