OnixS C++ CME iLink 3 Binary Order Entry Handler  1.17.0
API Documentation
Session.h
Go to the documentation of this file.
1 /*
2  * Copyright Onix Solutions Limited [OnixS]. All rights reserved.
3  *
4  * This software owned by Onix Solutions Limited [OnixS] and is protected by copyright law
5  * and international copyright treaties.
6  *
7  * Access to and use of the software is governed by the terms of the applicable OnixS Software
8  * Services Agreement (the Agreement) and Customer end user license agreements granting
9  * a non-assignable, non-transferable and non-exclusive license to use the software
10  * for it's own data processing purposes under the terms defined in the Agreement.
11  *
12  * Except as otherwise granted within the terms of the Agreement, copying or reproduction of any part
13  * of this source code or associated reference material to any other location for further reproduction
14  * or redistribution, and any amendments to this copyright notice, are expressly prohibited.
15  *
16  * Any reproduction or redistribution for sale or hiring of the Software not in accordance with
17  * the terms of the Agreement is a violation of copyright law.
18  */
19 
20 #pragma once
21 
22 #include <limits.h>
23 
24 #include <OnixS/CME/iLink3/ABI.h>
32 
33 namespace OnixS
34 {
35 namespace CME
36 {
37 namespace iLink3
38 {
39 
40 // Forward declarations
41 class TcpDirectStack;
42 
43 /**
44 * An iLink 3 Session.
45 */
47 {
48 public:
49  static const UInt64 UndefinedUuid = 0;
50 
51  /**
52  * Constructor.
53  *
54  * \param settings Session settings.
55  * \param marketSegmentId Market segment ID.
56  * \param listener Session listener.
57  * \param storageType Session storage type.
58  * \param storage Session storage.
59  * \param uuid Universally Unique Identifier (UUID).
60  * \param customKey Custom key that could be used to distinguish sessions with the same UUID, Session ID, FirmId, and Market Segment ID values.
61  */
62  Session(const SessionSettings &settings, int marketSegmentId,
64  SessionStorage *storage = ONIXS_ILINK3_NULLPTR, UInt64 uuid = UndefinedUuid, const std::string &customKey = "");
65 
66  Session(SessionReactor & stack, const SessionSettings & settings, int marketSegmentId,
68  SessionStorage * storage = ONIXS_ILINK3_NULLPTR, UInt64 uuid = UndefinedUuid, const std::string &customKey = "");
69 
70  ~Session();
71 
72  /// \return the Universally Unique Identifier (UUID).
73  UInt64 uuid() const ONIXS_ILINK3_NOTHROW;
74 
75  /// \return Session ID (assigned by the exchange).
76  std::string id() const;
77 
78  /// \return Market Segment ID.
79  int marketSegmentId() const ONIXS_ILINK3_NOTHROW;
80 
81  /// \return Custom key that could be used to distinguish sessions with the same UUID, Session ID, FirmId, and Market Segment ID values.
82  std::string customKey() const;
83 
84  /// \return `true` if the session is negotiated (the Negotiation Response message has been received in reply to the Negotiation message), otherwise - `false`.
85  bool negotiated() const;
86 
87  /// Sets the "negotiated" status.
88  ///
89  /// The session is negotiated when the Negotiation Response message has been received in reply to the Negotiation message.
90  Session& negotiated(bool negotiated);
91 
92  /// \return the Fault Tolerance Indicator (whether the connection is the primary or backup).
93  Messaging::FTI::Enum faultToleranceIndicator() const;
94 
95  /// Sets the Fault Tolerance Indicator (whether the connection is the primary or backup).
96  Session& faultToleranceIndicator(Messaging::FTI::Enum value);
97 
98  /**
99  * Establishes the connection.
100  *
101  * \param host Market Segment Gateway host.
102  * \param port Market Segment Gateway port.
103  *
104  * \return This session.
105  */
106  Session& connect(const std::string &host, Port port);
107 
108  /**
109  * Establishes the connection asynchronously.
110  *
111  * \param host Market Segment Gateway host.
112  * \param port Market Segment Gateway port.
113  */
114  Threading::SharedFuture<void> connectAsync(const std::string & host, Port port);
115 
116  /**
117  * Terminates the connection.
118  *
119  * \param reason Terminate reason details.
120  *
121  * \note Method blocks until the Terminate message is received in reply, or the timeout is elapsed.
122  *
123  * \return This session.
124  */
125  Session& disconnect(const std::string &reason = "");
126 
127  /**
128  * Terminates the connection asynchronously.
129  *
130  * \param reason Terminate reason details.
131  */
132  Threading::SharedFuture<void> disconnectAsync(const std::string & reason = "");
133 
134  /**
135  * Sends the message.
136  *
137  * \param sendingTime The time value to be used for a `sendingTimeEpoch` field of the message(s) being sent.
138  * \param msg The message to be sent.
139  *
140  * \note This call is thread-safe, except for the TCPDirect mode.
141  *
142  * \return This session.
143  */
144  template <typename SbeMessageType, size_t MaxMessageSize, typename MessageInitializer>
145  Session& send(
146  Messaging::MessageHolder<SbeMessageType, MaxMessageSize, MessageInitializer> &msg,
147  Messaging::Timestamp sendingTime = UtcWatch::now());
148 
149 #if defined (ONIXS_ILINK3_CXX11)
150 
151  /**
152  * Sends the message.
153  * \param sendingTime The time value to be used for a `sendingTimeEpoch` field of the message(s) being sent.
154  * \param msg The message to be sent.
155  *
156  * \note This call is thread-safe, except for the TCPDirect mode.
157  *
158  * \return This session.
159  */
160  template <typename SbeMessageType, size_t MaxMessageSize, typename MessageInitializer>
161  Session& send(
163  Messaging::Timestamp sendingTime = UtcWatch::now());
164 
165 #endif
166 
167  /// CME states: Packet size maximum behavior based on MTU (Maximum Transmission Unit) - 1420 bytes, as defined on our network.
168  static const size_t CmeMaxPacketSize = 1420;
169 
170 #if defined (ONIXS_ILINK3_CXX11)
171 
172  /**
173  * Sends messages.
174  *
175  * \note This call is thread-safe.
176  *
177  * \param msgs Message batch to send.
178  * \param maxPacketSize The maximum number of bytes written to the socket's send buffer together.
179  * This parameter could be used to reduce the probability that the operating system will fragment the message across multiple TCP packets.
180  * \param sendingTime The time value to be used for a `sendingTimeEpoch` field of the message(s) being sent.
181  *
182  * \note The maxPacketSize parameter should not be less than any message size in the batch.
183  * Otherwise, the method call can produce an error and the session can close the connection.
184  *
185  * \return This session.
186  */
187  template <typename SbeMessageType, size_t MaxMessageSize, typename MessageInitializer>
188  Session& send(
190  Messaging::Timestamp sendingTime = UtcWatch::now(),
191  size_t maxPacketSize = CmeMaxPacketSize);
192 
193  /**
194  * Sends messages.
195  *
196  * \note This call is thread-safe.
197  *
198  * \param msgs Message batch combiner to send.
199  * \param maxPacketSize The maximum number of bytes written to the socket's send buffer together.
200  * This parameter could be used to reduce the probability that the operating system will fragment the message across multiple TCP packets.
201  * \param sendingTime The time value to be used for a `sendingTimeEpoch` field of the message(s) being sent.
202  *
203  * \note The maxPacketSize parameter should not be less than any message size in the batch.
204  * Otherwise, the method call can produce an error and the session can close the connection.
205  *
206  * \return This session.
207  */
208  Session& send(
209  MessageBatchCombiner & msgs,
210  Messaging::Timestamp sendingTime = UtcWatch::now(),
211  size_t maxPacketSize = CmeMaxPacketSize);
212 
213 #endif
214 
215  /**
216  * Send the Sequence message.
217  *
218  * \note The session sends Sequence messages automatically per the CME iLink protocol.
219  * This method should be used only if an ad hoc Sequence message is required
220  * and the connection is established.
221  *
222  * \param keepAliveLapsed Indicates whether one Keep Alive interval has lapsed without any message received.
223  *
224  * \return This session.
225  */
226  Session& sendSequenceMessage(Messaging::KeepAliveLapsed::Enum keepAliveLapsed = Messaging::KeepAliveLapsed::Lapsed);
227 
228  /**
229  * Warms up the sending path.
230  *
231  * \param msg SBE message to warm up the sending path.
232  * \param warmupFlags Specific flags which can be used to turn on the warmup feature for a specific NIC.
233  * \param sendingTime The time value to be used for a `sendingTimeEpoch` field of the message(s) being sent.
234  *
235  * \note This call is thread-safe, except for the TCPDirect mode.
236  *
237  * \return This session.
238  */
239  template <typename SbeMessageType, size_t MaxMessageSize>
240  Session& warmUp(
242  Messaging::Timestamp sendingTime = UtcWatch::now(),
243  int warmupFlags = 0);
244 
245 
246 #if defined (ONIXS_ILINK3_CXX11)
247 
248  /**
249  * Warms up the sending path.
250  *
251  * \note This call is thread-safe.
252  *
253  * \param msgs Message batch to send.
254  * \param maxPacketSize The maximum number of bytes written to the socket's send buffer together during the subsequent `send` call.
255  * \param sendingTime The time value to be used for a `sendingTimeEpoch` field of the message(s) being sent.
256  * \param warmupFlags Specific flags which can be used to turn on the warmup feature for a specific NIC.
257  *
258  * \note The maxPacketSize parameter should not be less than any message size in the batch.
259  * Otherwise, the method call can produce an error and the session can close the connection.
260  *
261  * \return This session.
262  */
263  template <typename SbeMessageType, size_t MaxMessageSize, typename MessageInitializer>
264  Session& warmUp(
266  Messaging::Timestamp sendingTime = UtcWatch::now(),
267  size_t maxPacketSize = CmeMaxPacketSize,
268  int warmupFlags = 0);
269 
270  /**
271  * Warms up the sending path.
272  *
273  * \note This call is thread-safe.
274  *
275  * \param msgs Message batch combiner to send.
276  * \param maxPacketSize The maximum number of bytes written to the socket's send buffer together during the subsequent `send` call.
277  * \param sendingTime The time value to be used for a `sendingTimeEpoch` field of the message(s) being sent.
278  * \param warmupFlags Specific flags which can be used to turn on the warmup feature for a specific NIC.
279  *
280  * \note The maxPacketSize parameter should not be less than any message size in the batch.
281  * Otherwise, the method call can produce an error and the session can close the connection.
282  *
283  * \return This session.
284  */
285  Session& warmUp(
287  size_t maxPacketSize = CmeMaxPacketSize, int warmupFlags = 0);
288 #endif
289 
290  /**
291  * Performs throttling of a session that must be called before each of a send function call.
292  * If the count of messages per a time unit exceeds a throttling limit (by default, the CME minimum threshold is used - 100 messages per second),
293  * the function will be blocked until the given time interval is passed.
294  *
295  * \note This call is thread-safe.
296  */
297  Session & throttle();
298 
299  /**
300  * Sets throttling limit parameters.
301  *
302  * \param messagesCount Message limit per a time unit.
303  * \param intervalInMs Time interval to limit messages.
304  *
305  * \note This call is thread-safe.
306  */
307  Session & throttlingLimit(size_t messagesCount, size_t intervalInMs = 1000);
308 
309  /// \return the host name the session is connected to.
310  std::string remoteHost() const;
311 
312  /// \return the IP address the session is connected to.
313  std::string remoteIpAddress() const;
314 
315  /// \return the port number the session is connected to.
316  Port remotePort() const;
317 
318  /// \return the local port range
319  std::pair<Port, Port> localPortRange() const ONIXS_ILINK3_NOTHROW;
320 
321  /// Sets the local port range
322  Session& localPortRange(std::pair<Port, Port> portRange);
323 
324  /// \return the IP Address or name of the local network interface.
325  std::string localNetworkInterface() const;
326 
327  /// Sets the IP Address or name of the local network interface.
328  Session& localNetworkInterface(const std::string &value);
329 
330  /// \return the local network port number.
331  Port localPort() const;
332 
333  /// \return the value of the `TCP_NODELAY` option (improve latency at the expense of message throughput).
334  bool tcpNoDelayOption() const;
335 
336  /// Sets the `TCP_NODELAY` option (improve latency at the expense of message throughput).
337  Session& tcpNoDelayOption(bool value);
338 
339  /// \return Socket options.
340  const SocketOptions &socketOptions() const;
341 
342  /// Sets socket options.
343  Session& socketOptions(const SocketOptions &options);
344 
345  static const int UndefinedAffinity = -1;
346 
347  /// Sets the receiving thread CPU affinity.
348  Session& receivingThreadAffinity(CpuIndex cpuIndex);
349 
350  /// \return the receiving thread CPU affinity.
351  Session& receivingThreadAffinity(const CpuIndexes &cpuIndexes);
352 
353  /// Sets the receiving thread CPU affinity.
354  const CpuIndexes &receivingThreadAffinity() const;
355 
356  /// Sets the sending thread CPU affinity.
357  Session& sendingThreadAffinity(CpuIndex cpuIndex);
358 
359  /// Sets the sending thread CPU affinity.
360  Session& sendingThreadAffinity(const CpuIndexes &cpuIndexes);
361 
362  /// \return the auxiliary sending thread CPU affinity.
363  const CpuIndexes &sendingThreadAffinity() const;
364 
365  /// \return the scheduling priority of the receiving thread.
366  int receivingThreadPriority() const;
367 
368  /// Sets the scheduling priority of the receiving thread.
369  Session& receivingThreadPriority(int priority);
370 
371  /// \return the scheduling priority of the sending thread.
372  int sendingThreadPriority() const;
373 
374  /// \return the scheduling priority of the sending thread.
375  Session& sendingThreadPriority(int priority);
376 
377  /// \return the receiving thread policy.
378  int receivingThreadPolicy() const;
379 
380  /// Sets the receiving thread policy.
381  Session& receivingThreadPolicy(int policy);
382 
383  /// Sets the sending thread policy.
384  int sendingThreadPolicy() const;
385 
386  /// \return the sending thread policy.
387  Session& sendingThreadPolicy(int policy);
388 
389  /// \return the receive spinning timeout value (in microseconds).
390  unsigned receiveSpinningTimeout() const ONIXS_ILINK3_NOTHROW;
391 
392  /// Sets the receive spinning timeout value (in microseconds).
393  Session& receiveSpinningTimeout(unsigned timeoutInUs);
394 
395  /// \return the send spinning timeout value (in microseconds).
396  unsigned sendSpinningTimeout() const ONIXS_ILINK3_NOTHROW;
397 
398  /// Sets the send spinning timeout value (in microseconds).
399  Session& sendSpinningTimeout(unsigned timeoutInUs);
400 
401  /// \return `true` if new messages are reported even when the message gap is detected,
402  /// and the reply on the [Retransmit Request](https://www.cmegroup.com/confluence/display/EPICSANDBOX/Retransmit+Request)
403  /// message is expected, otherwise - `false`.
404  bool reportNewMessagesWhileWaitingForMissedMessages() const;
405 
406  /// Sets the option to report new messages even when the message gap is detected,
407  /// and the reply on the [Retransmit Request](https://www.cmegroup.com/confluence/display/EPICSANDBOX/Retransmit+Request)
408  /// message is expected.
409  Session& reportNewMessagesWhileWaitingForMissedMessages(bool value);
410 
411  /// \return the number of messages to be sent together.
412  unsigned messageGrouping() const ONIXS_ILINK3_NOTHROW;
413 
414  /**
415  * Sets the number of messages to be sent together.
416  *
417  * \param numberOfMessagesToGroup If the parameter is zero (by default) or one, the Handler tries to send
418  * an outgoing application-level message in the context of the thread that calls the OnixS::CME::iLink3::Session::send method.
419  * If the message cannot be sent immediately, it is stored in the queue for the subsequent sending by the sending thread.
420  * If this parameter is larger than one, the Handler stores outgoing SBE messages in the queue for the subsequent sending by the sending thread.
421  *
422  * \return This session.
423  */
424  Session& messageGrouping(unsigned numberOfMessagesToGroup);
425 
426  /// \return Session storage type.
427  SessionStorageType::Enum storageType() const ONIXS_ILINK3_NOTHROW;
428 
429  /// \return Session storage ID.
430  const std::string &storageId() const ONIXS_ILINK3_NOTHROW;
431 
432  /// \return the sequence number of the next outgoing message.
433  SeqNumber outSeqNum() const ONIXS_ILINK3_NOTHROW;
434 
435  /// Sets the sequence number of the next outgoing message.
436  Session& outSeqNum(SeqNumber nextOutSeqNum);
437 
438  /// \return the expected sequence number of the next inbound message.
439  SeqNumber inSeqNum() const;
440 
441  /// Sets the expected sequence number of the next inbound message.
442  Session& inSeqNum(SeqNumber nextExpectedInSeqNum);
443 
444  /**
445  * \return the sequence number of the last business message published by CME with the PreviousUUID.
446  *
447  * If no business message was published, the value is zero.
448  */
449  SeqNumber previousSeqNo() const ONIXS_ILINK3_NOTHROW;
450 
451  /// Sets the sequence number of the last business message published by CME with the PreviousUUID.
452  Session& previousSeqNo(SeqNumber value);
453 
454  /**
455  * \return The UUID from the previously Established session.
456  *
457  * - This can be the CME assigned default UUID=0 for messages published by CME before first Negotiation of customer at the beginning of the week.
458  * - This can be the last UUID as used by the customer from the previously Established session.
459  */
460  Messaging::UInt64 previousUuid() const ONIXS_ILINK3_NOTHROW;
461 
462  /// Sets the UUID from the previously Established session.
463  Session& previousUuid(Messaging::UInt64 value);
464 
465  /**
466  * Backups the current log files, resets the sequence numbers to 1 and generates a new UUID.
467  *
468  * \warning Can be called only when the session is disconnected.
469  *
470  * \param startOfWeek if `true` then the PreviousUUID and PreviousSeqNum are reset to 0.
471  *
472  * \return This session.
473  */
474  Session& reset(bool startOfWeek = false);
475 
476  /// \return Session's current state.
477  SessionStateId::Enum state() const;
478 
479  /// \return the time when the session was created or the last reset operation was performed.
480  Messaging::Timestamp creationTime() const ONIXS_ILINK3_NOTHROW;
481 
482  /// Flushes all internal buffers of the session storage.
483  void flushSessionStorage();
484 
485  /// \return the maximum number of tries to restore the telecommunications link.
486  unsigned reconnectAttempts() const;
487 
488  /// Sets the maximum number of tries to restore the telecommunications link.
489  Session& reconnectAttempts(unsigned reconnectAttempts);
490 
491  /// \return the time interval between retries to restore the telecommunications link (seconds).
492  unsigned reconnectInterval() const;
493 
494  /// Sets the time interval between retries to restore the telecommunications link (seconds).
495  Session& reconnectInterval(unsigned seconds);
496 
497  /// \return the usage of local time in Handler events and logs files.
498  bool localTimeUsage() const;
499 
500  /// Specifies the usage of local time in Handler events and logs files.
501  Session& localTimeUsage(bool useLocalTime);
502 
503  /// \return The session storage directory.
504  const std::string &storageDirectory() const;
505 
506  /// \return `true` if logging of an outgoing message to the session storage is performed before sending it to the wire, otherwise - `false`.
507  bool logBeforeSending() const;
508 
509  /// Sets the option to log an outgoing message to the session storage before sending it to the wire.
510  Session& logBeforeSending(bool value);
511 
512  /// \return the maximum size of the message queue used during message gap recovery.
513  size_t incomingMessageGapQueueMaximumSize() const;
514 
515  /// Sets the maximum size of the message queue used during message gap recovery.
516  Session& incomingMessageGapQueueMaximumSize(size_t value);
517 
518  /// Write the given user's message to the Handler's log file using the session formatted Id.
519  const Session& log(const std::string &message) const;
520 
521  /// \return the human-friendly description.
522  std::string toString() const;
523 
524  /// \return the license expiration date.
525  Messaging::Timestamp licenseExpirationDate() const;
526 
527  /// \return the version of the message schema.
528  Messaging::SchemaVersion messagingVersion() const ONIXS_ILINK3_NOTHROW;
529 
530  /// \return the value of the option to detect the message gap for the previous UUID.
531  bool detectMessageGapForPreviousUuid() const;
532 
533  /// Sets the value of the option to detect the message gap for the previous UUID.
534  Session& detectMessageGapForPreviousUuid(bool detectGap);
535 
536  /// Represents invalid value of socket handle.
537  static const Handle InvalidSocketHandle;
538 
539  /// Returns the socket handle which the session uses to transmit data.
540  ///
541  /// \note The TCPDirect mode does not support this method, so it always returns the `InvalidSocketHandle` value.
542  Handle socketHandle();
543 
544  /// Returns the total number of bytes in the outbound queue.
545  size_t outboundQueueBytes();
546 
547  /// \return the version of the library.
548  static const std::string& version() ONIXS_ILINK3_NOTHROW;
549 
550 private:
551  Session(const Session& );
552  Session& operator=(const Session& );
553 
554  void send(NetworkMessage msg, Messaging::Timestamp ts);
555  void send(NetMessages& msgs, size_t maxPacketSize, Messaging::Timestamp ts);
556  void warmUp(NetworkMessage msg, int warmupFlags, Messaging::Timestamp ts);
557  void warmUp(NetMessages& msgs, size_t maxPacketSize, int warmupFlags, Messaging::Timestamp ts);
558 
559  template <typename SbeMessageType, size_t MaxMessageSize, typename MessageInitializer>
560  void validate(const Messaging::MessageHolder<SbeMessageType, MaxMessageSize, MessageInitializer> &msg) const;
561 
562  void validateVersion(Messaging::SchemaVersion version) const;
563 
564  struct Impl;
565  Impl *const impl_;
566 };
567 
568 /**
569 * An iLink 3 Session for CME Convenience Gateways (CGW).
570 */
571 class ONIXS_ILINK3_EXPORTED CgwSession : public Session
572 {
573 public:
574  /**
575  * Constructor.
576  *
577  * \param settings Session settings.
578  * \param listener Session listener.
579  * \param storageType Session storage type.
580  * \param storage Session storage.
581  * \param uuid Universally Unique Identifier (UUID).
582  * \param customKey Custom key that could be used to distinguish sessions with the same UUID, Session ID and FirmId values.
583  */
584  CgwSession(const SessionSettings &settings,
586  SessionStorage *storage = ONIXS_ILINK3_NULLPTR, UInt64 uuid = UndefinedUuid, const std::string &customKey = "");
587 
588  /**
589  * Constructor.
590  *
591  * \param stack Externally provided reactor.
592  * \param settings Session settings.
593  * \param listener Session listener.
594  * \param storageType Session storage type.
595  * \param storage Session storage.
596  * \param uuid Universally Unique Identifier (UUID).
597  * \param customKey Custom key that could be used to distinguish sessions with the same UUID, Session ID and FirmId values.
598  */
599  CgwSession(SessionReactor & stack, const SessionSettings & settings,
601  SessionStorage * storage = ONIXS_ILINK3_NULLPTR, UInt64 uuid = UndefinedUuid, const std::string &customKey = "");
602 
603 private:
604  int marketSegmentId() const ONIXS_ILINK3_NOTHROW;
605  static const int marketSegmentId_ = INT_MAX;
606 };
607 
608 template <typename SbeMessageType, size_t MaxMessageSize, typename MessageInitializer>
611 {
612  assert(ts != Messaging::Timestamp());
613 
614 #ifndef NDEBUG
615  validate(msg);
616 #endif
617 
618  send(msg.toNetworkMessage(), ts);
619 
620  return *this;
621 }
622 
623 template <typename SbeMessageType, size_t MaxMessageSize>
627  Messaging::Timestamp sendingTime,
628  int warmupFlags)
629 {
630  warmUp(msg.toNetworkMessage(), warmupFlags, sendingTime);
631 
632  return *this;
633 }
634 
635 #if defined (ONIXS_ILINK3_CXX11)
636 
637 template <typename SbeMessageType, size_t MaxMessageSize, typename MessageInitializer>
640 {
641  assert(ts != Messaging::Timestamp());
642 
643  send(msg, ts);
644  return *this;
645 }
646 
647 #endif
648 
649 #if defined (ONIXS_ILINK3_CXX11)
650 
651 template <typename SbeMessageType, size_t MaxMessageSize, typename MessageInitializer>
656  size_t maxPacketSize)
657 {
658  assert(ts != Messaging::Timestamp());
659 
660  send(msgs.netMsgs_, maxPacketSize, ts);
661  return *this;
662 }
663 
664 template <typename SbeMessageType, size_t MaxMessageSize, typename MessageInitializer>
668  Messaging::Timestamp ts, size_t maxPacketSize, int flags)
669 {
670  assert(ts != Messaging::Timestamp());
671 
672  warmUp(msgs.netMsgs_, maxPacketSize, flags, ts);
673  return *this;
674 }
675 
676 #endif
677 
678 template <typename SbeMessageType, size_t MaxMessageSize, typename MessageInitializer>
680 {
681  Messaging::validate(holder);
682  validateVersion(holder->version());
683 }
684 
685 }
686 }
687 }
#define ONIXS_ILINK3_NULLPTR
Definition: Compiler.h:174
An iLink 3 Session.
Definition: Session.h:46
std::vector< NetworkMessage > NetMessages
Definition: MessageBatch.h:42
Contains the SimpleOpenFramingHeader, the SBE message, and the data buffer.
Session&#39;s network stack reactor interface.
Session & send(Messaging::MessageHolder< SbeMessageType, MaxMessageSize, MessageInitializer > &msg, Messaging::Timestamp sendingTime=UtcWatch::now())
Sends the message.
Definition: Session.h:610
Messaging::UInt32 SeqNumber
Definition: Messaging.h:60
void validate(const Message &)
Definition: Validation.h:32
unsigned short Port
Definition: Defines.h:44
MessageHeader::Version SchemaVersion
SBE-encoded data version type.
Definition: SchemaTraits.h:30
STL namespace.
std::set< CpuIndex > CpuIndexes
Definition: Defines.h:73
Definition: Defines.h:40
An iLink 3 Session for CME Convenience Gateways (CGW).
Definition: Session.h:571
size_t CpuIndex
Definition: Defines.h:72
int Handle
Type alias for socket handle.
Definition: Defines.h:56
#define ONIXS_ILINK3_EXPORTED
Definition: Compiler.h:167
Session & warmUp(Messaging::MessageHolder< SbeMessageType, MaxMessageSize > &msg, Messaging::Timestamp sendingTime=UtcWatch::now(), int warmupFlags=0)
Warms up the sending path.
Definition: Session.h:625
UInt64 UInt64
uInt64.
Definition: Fields.h:308
The class can be used to combine messages with different types to the batch for sending.
Definition: MessageBatch.h:139
std::vector< SocketOption > SocketOptions
Socket options.
Definition: Defines.h:77
#define ONIXS_ILINK3_HOTPATH
Definition: Compiler.h:179
The time point without the time-zone information.
Definition: Time.h:467
#define ONIXS_ILINK3_NOTHROW
Definition: Compiler.h:168
NetworkMessage toNetworkMessage() noexcept