nw_framer_output_handler_t
A handler that notifies your protocol about a new outbound message.
Declaration
typealias nw_framer_output_handler_t = (nw_framer_t, nw_framer_message_t, Int, Bool) -> VoidParameters
- 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.