Type Alias

nw_framer_output_handler_t

A handler that notifies your protocol about a new outbound message.

Declaration

typedef void (^nw_framer_output_handler_t)(nw_framer_t framer, nw_framer_message_t message, size_t message_length, bool is_complete);

Parameters

framer

The framer instance associated with the connection.

message

The framer message passed by the application.

message_length

The length of the message content being sent.

is_complete

A boolean indicating if this the last chunk of a message.

Discussion

The output handler is your opportunity to encapsulate or encode a signle application message. You should write any output using nw_framer_write_output, nw_framer_write_output_data, or nw_framer_write_output_no_copy before returning from the output handler. If you do not write a message, the application message will be discarded.

See Also

Handling Output Data

nw_framer_set_output_handler

Sets a block to handle new outbound messages.

nw_framer_parse_output

Examines the content of output data while inside your output handler.

nw_framer_parse_completion_t

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

nw_framer_write_output

Sends arbitrary output data in a buffer from your protocol to the next protocol.

nw_framer_write_output_data

Sends arbitrary output data from your protocol to the next protocol.

nw_framer_write_output_no_copy

Sends a specific number of bytes from a message while inside your output handler.

nw_framer_pass_through_output

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