Function

nw_framer_parse_input

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

Declaration

bool nw_framer_parse_input(nw_framer_t framer, size_t minimum_incomplete_length, size_t maximum_length, uint8_t *temp_buffer, nw_framer_parse_completion_t parse);

Parameters

minimum_incomplete_length

The minimum number of bytes that should be delivered to the parse completion.

maximum_length

The maximum number of bytes that should be delivered to the parse completion.

temp_buffer

An optional buffer into which the parser will copy bytes. Use this if you need to make guarantees about byte alignment.

parse

A completion handler that will be called inline to examine a region of bytes.

Return Value

Returns true if the requested length was available to parse, or false if the conditions could not be met.

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_completion_t

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

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.