message_base::payload() reports the payload type of a message. In the case of a message with invalid framing headers, it returns payload::error, which means the parser on the receiving side would reject the message.
The serializer should report the error on the first attempt to write the message, before writing the message header.
A dedicated error code might be needed for this.
message_base::payload()reports the payload type of a message. In the case of a message with invalid framing headers, it returnspayload::error, which means the parser on the receiving side would reject the message.The serializer should report the error on the first attempt to write the message, before writing the message header.
A dedicated error code might be needed for this.