Interface IProtobufFeature
Represents a feature used to customize the encoding and decoding of request and response payloads.
public interface IProtobufFeature
Properties
EncodeOptions
Gets the options to use when encoding the payload of an outgoing response.
ProtobufEncodeOptions? EncodeOptions { get; }
Property Value
MaxMessageLength
Gets the maximum length of an encoded Protobuf message, in bytes.
int MaxMessageLength { get; }
Property Value
- int
The maximum length of a Protobuf message, in bytes.
Remarks
This limit applies only when decoding the payload of an incoming request or response, whether this
payload holds a single message or a stream of messages: the decoding throws
InvalidDataException when the length encoded in the 5-byte prefix of a message exceeds this
maximum, before parsing any byte of the message. It does not restrict the length of the messages encoded by the
application. The message length does not include this prefix. Implementations must return a value greater than
or equal to 0.