Class BinaryMarketDataClient
java.lang.Object
com.quantfinlib.sbe.BinaryMarketDataClient
- All Implemented Interfaces:
AutoCloseable
Binary market-data adapter: decodes
TradeFlyweight frames from a
channel straight into the HftMarketDataBus — the professional-grade
counterpart of the text feed.WebSocketFeed. The read loop reuses
one direct buffer and one flyweight: zero allocation per message,
partial frames handled by compacting, so TCP segmentation can never split
a decode.
Symbol numbering is part of the wire contract: both ends must agree on the dense symbol ids (register the same symbols in the same order on the bus). This is exactly how binary exchange feeds work — ids are assigned in the session/reference-data channel, not repeated per tick.
Single reader thread per client (the bus's single-producer contract).
-
Constructor Summary
ConstructorsConstructorDescriptionBinaryMarketDataClient(ReadableByteChannel channel, HftMarketDataBus bus) BinaryMarketDataClient(ReadableByteChannel channel, HftMarketDataBus bus, int bufferBytes) -
Method Summary
-
Constructor Details
-
BinaryMarketDataClient
-
BinaryMarketDataClient
-
-
Method Details
-
start
public void start() -
messagesDecoded
public long messagesDecoded() -
failureReason
Non-null once the reader stopped on a protocol or I/O error. -
close
- Specified by:
closein interfaceAutoCloseable- Throws:
IOException
-