Reset Method | Table of Content | FIXForge.NET.FIX.Fix2FixmlConverter |
InputDataTraits Enumeration |
This enumeration allows to setup decoder in dependent-decoding (i.e. decodeEachMessageIndependently == false) mode for particular characteristics of the input data stream.
CompleteMessagesOnly The input data should contain only complete messages. This allows to perform decoding faster, but requires explicit call of Decoder.Reset() when someone error occurs or Decoder.Decode() returns NULL. Please note that Decoder.Decode() will fire exception if such reset was omitted after exception or NULL returned.
This commonly prohibits usage of the mode for decoding streaming data like TCP/IP stream. On another hand the mode is highly recommended for the data distributed via UDP multicasting or other packet transport which requires reset of decoder at someone strongly determined points.
CouldContainPartialMessages Input data could contain partial messages. Decoding being performed a little slower than in case of CompleteMessagesOnly but could be used for stream data decoding using following method:
Decoder decoder = new Decoder(templates, dictionary, false, InputDataTraits.CouldContainPartialMessages); .. Message message = null; while(message == null) { /* consume some data */ message = decoder.Decode(buffer, offset, count, out ref numberOfDecodedBytes); }
Namespace: FIXForge.NET.FIX.FAST
public enum InputDataTraits
Member name | Value | Description | |
---|---|---|---|
CompleteMessagesOnly | 0 | Faster decoding but requires explicit decoder reset when an error occurs. | |
CouldContainPartialMessages | 1 | Slower decoding allows trying to decode incomplete messages as well as handling of wrong/damaged data without subsequent explicit reset. |