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