33 namespace ConflatedTCP
41 static const UInt64 UndefinedUuid = 0;
65 const std::string id()
const;
68 int marketSegmentId()
const;
71 const std::string customKey()
const;
81 Session& connect(
const std::string &host,
Port port);
92 Session& disconnect(
const std::string &reason =
"Terminate");
101 template <
typename SbeMessageType,
size_t MaxMessageSize,
typename MessageInitializer>
104 #if defined(ONIXS_CONFLATEDTCP_CXX11) 113 template <
typename SbeMessageType,
size_t MaxMessageSize,
typename MessageInitializer>
118 #if defined(ONIXS_CONFLATEDTCP_CXX11) 127 template <
typename SbeMessageType,
size_t MaxMessageSize,
typename MessageInitializer>
132 #if defined(ONIXS_CONFLATEDTCP_CXX11) 141 template <
typename SbeMessageType,
size_t MaxMessageSize,
typename MessageInitializer>
147 std::string remoteHost()
const;
150 std::string remoteIpAddress()
const;
153 Port remotePort()
const;
156 std::pair<Port, Port> localPortRange()
const;
159 Session& localPortRange(std::pair<Port, Port> portRange);
162 std::string localNetworkInterface()
const;
165 Session& localNetworkInterface(
const std::string &value);
168 Port localPort()
const;
171 bool tcpNoDelayOption()
const;
174 Session& tcpNoDelayOption(
bool value);
182 static const int UndefinedAffinity = -1;
191 const CpuIndexes &receivingThreadAffinity()
const;
200 const CpuIndexes &sendingThreadAffinity()
const;
203 int receivingThreadPriority()
const;
206 Session& receivingThreadPriority(
int priority);
209 int sendingThreadPriority()
const;
212 Session& sendingThreadPriority(
int priority);
215 int receivingThreadPolicy()
const;
218 Session& receivingThreadPolicy(
int policy);
221 int sendingThreadPolicy()
const;
224 Session& sendingThreadPolicy(
int policy);
227 unsigned receiveSpinningTimeout()
const;
230 Session& receiveSpinningTimeout(
unsigned timeoutInUs);
233 unsigned sendSpinningTimeout()
const;
236 Session& sendSpinningTimeout(
unsigned timeoutInUs);
241 bool reportNewMessagesWhileWaitingForMissedMessages()
const;
246 Session& reportNewMessagesWhileWaitingForMissedMessages(
bool value);
249 bool validateSequenceNumbers()
const;
252 Session& validateSequenceNumbers(
bool validate);
255 unsigned messageGrouping()
const;
267 Session& messageGrouping(
unsigned numberOfMessagesToGroup);
273 const std::string &storageId()
const;
317 Session& reset(
bool startOfWeek =
false);
326 void flushSessionStorage();
329 unsigned reconnectAttempts()
const;
332 Session& reconnectAttempts(
unsigned reconnectAttempts);
335 unsigned reconnectInterval()
const;
338 Session& reconnectInterval(
unsigned seconds);
341 bool localTimeUsage()
const;
344 Session& localTimeUsage(
bool useLocalTime);
347 const std::string &storageDirectory()
const;
350 bool logBeforeSending()
const;
353 Session& logBeforeSending(
bool value);
356 size_t incomingMessageGapQueueMaximumSize()
const;
359 Session& incomingMessageGapQueueMaximumSize(
size_t value);
362 const Session& log(
const std::string &message)
const;
365 std::string toString()
const;
372 void send(std::vector<Messaging::SbeMessage> msgs, std::vector<Messaging::SimpleOpenFramingHeader *> headers);
379 template <
typename SbeMessageType,
size_t MaxMessageSize,
typename MessageInitializer>
389 #if defined(ONIXS_CONFLATEDTCP_CXX11) 391 template <
typename SbeMessageType,
size_t MaxMessageSize,
typename MessageInitializer>
401 #if defined(ONIXS_CONFLATEDTCP_CXX11) 403 template <
typename SbeMessageType,
size_t MaxMessageSize,
typename MessageInitializer>
406 std::vector<Messaging::SbeMessage> messages(msgs.size());
407 std::vector<Messaging::SimpleOpenFramingHeader *> headers(msgs.size());
409 for (
size_t i = 0; i < msgs.size(); ++i)
417 send(messages, headers);
424 #if defined(ONIXS_CONFLATEDTCP_CXX11) 426 template <
typename SbeMessageType,
size_t MaxMessageSize,
typename MessageInitializer>
430 return send(messages);
An Conflated TCP Session.
Messaging::UInt32 SeqNumber
Contains the SimpleOpenFramingHeader, the SBE message, and the data buffer.
#define ONIXS_CONFLATEDTCP_EXPORTED
File-based Session Storage.
Session & send(Messaging::MessageHolder< SbeMessageType, MaxMessageSize, MessageInitializer > &msg)
Sends the message.
std::vector< SocketOption > SocketOptions
Socket options.
std::set< CpuIndex > CpuIndexes
The time point without the time-zone information.
MessageSize setHeader() noexcept
Calculates the binary size of the message and updates the Simple Open Framing Header accordingly...
UInt16 MessageSize
Message length type.
Callbacks invoked by Handler during market data processing to reflect various stages of processing...
std::vector< MessageHolder< MessageTypeT, MaxMessageSize, MessageInitializer > > MessageHolders
const SimpleOpenFramingHeader * header() const noexcept
#define ONIXS_CONFLATEDTCP_NULLPTR