OnixS C++ FIX Engine  4.2.0
API Documentation
IEngineListener.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 <string>
23 
24 #include <OnixS/FIXEngine/ABI.h>
25 
26 namespace OnixS {
27 namespace FIX {
28 ONIXS_FIXENGINE_API_DECL(class, Message);
29 ONIXS_FIXENGINE_API_DECL(class, Session);
30 
31 /// Warning reason.
33  enum Enum {
34  /// General system-related warning.
36 
37  /// First message cannot be received during timeout.
39 
40  /// Garbled message is received.
42 
43  /// Session state cannot be changed.
45 
46  /// License expiration warning.
48  };
49 };
50 
51 /// Error reason.
53  enum Enum {
54  /// Cannot backup the file.
56 
57  /// Exception was thrown during reading of the sent message.
59 
60  /// General system-related error.
62 
63  /// Internal error, please contact support@onixs.biz to investigate the issue.
65 
66  /// Session state cannot be restored.
68 
69  /// Socket options cannot be set.
70  SetSocketOptionError
71  };
72 };
73 
74 /// Engine's Listener.
76 {
77 public:
78  /// @note FIX Engine does NOT manage the lifetime of this listener.
79  virtual ~IEngineListener() {};
80 
81  /// Called when an unknown incoming FIX connection is detected.
82  ///
83  /// To accept the connection dynamic new session may be created in scope of this callback with appropriate
84  /// TargetCompID, SenderCompID and FIX version/dialect.
85  /// This dynamically created session should be logon as acceptor otherwise the incoming connection will be rejected.
86  ///
87  /// If the dynamic session will not be created then incoming connection will be rejected and the rejectReason could be specified then the Logout(5) message will be sent to the counterparty.
88  ///
89  /// @param[in] incomingLogon Incoming Logon message. In general it is needed to examine the content and properties of this message
90  /// to create appropriate acceptor.
91  ///
92  /// @param[in] listenPort Listen port.
93  ///
94  /// @param[in] counterpartyPort Counterparty port.
95  ///
96  /// @param[in] counterpartyIpAddress Counterparty IP address.
97  ///
98  /// @param[out] rejectReason To send the Logout message before closing the rejected connection set the rejection description to this parameter.
99  virtual void onUnknownIncomingConnection(const Message & incomingLogon, const int listenPort,
100  const int counterpartyPort, const std::string & counterpartyIpAddress,
101  std::string * rejectReason) = 0;
102 
103  /// Called when an error is detected.
104  ///
105  /// @param[in] reason Error reason.
106  ///
107  /// @param[in] description Error description.
108  virtual void onError(EngineErrorReason::Enum reason, const std::string & description) = 0;
109 
110  /// Called when an warning is detected.
111  ///
112  /// @param[in] reason Warning reason.
113  ///
114  /// @param[in] description Warning description.
115  virtual void onWarning(EngineWarningReason::Enum reason, const std::string & description) = 0;
116 };
117 }
118 }
Exception was thrown during reading of the sent message.
Internal error, please contact support@onixs.biz to investigate the issue.
ONIXS_FIXENGINE_API_DECL(class, IEngineListener)
First message cannot be received during timeout.
#define ONIXS_FIXENGINE_API
Definition: ABI.h:45
General system-related error.
Engine&#39;s Listener.
Encapsulates operations over a FIX Message.
Definition: Message.h:49