bool parse_report(string&, SecurityOracle&, ExecutionReport*);
This commit is contained in:
1 parent
7a761d00ce
commit
4e4a48283d
8 files changed
+107
-59
No files matched your search
@@ -1 +1 @@
|
||||
set(sources /home/ppinto/Dropbox/bts/spark/doc/user/build.sh;content/_index.md;content/bts_spark/Glossary/_index.md;content/bts_spark/Help/_index.md;content/bts_spark/Help/about_spark.png;content/bts_spark/Help/image39.png;content/bts_spark/Help/image58.png;content/bts_spark/Launcher/_index.md;content/bts_spark/Launcher/image38.png;content/bts_spark/Launcher/image68.png;content/bts_spark/Logging-In-to-the-System/_index.md;content/bts_spark/Logging-In-to-the-System/image3.png;content/bts_spark/Logging-In-to-the-System/image64.png;content/bts_spark/Market/_index.md;content/bts_spark/Market/change_securities.png;content/bts_spark/Market/image11.png;content/bts_spark/Market/image14.png;content/bts_spark/Market/image20.png;content/bts_spark/Market/image21.png;content/bts_spark/Market/image23.png;content/bts_spark/Market/image24.png;content/bts_spark/Market/image34.png;content/bts_spark/Market/image49.png;content/bts_spark/Market/image53.png;content/bts_spark/Market/image66.png;content/bts_spark/Market/image69.png;content/bts_spark/Market/market_view.png;content/bts_spark/Market/settings_icon.png;content/bts_spark/Market/time_and_sales.png;content/bts_spark/My-Windows/_index.md;content/bts_spark/My-Windows/image15.png;content/bts_spark/My-Windows/image16.png;content/bts_spark/My-Windows/image37.png;content/bts_spark/Settings/_index.md;content/bts_spark/Settings/image51.png;content/bts_spark/Settings/image9.png;content/bts_spark/Spreader/_index.md;content/bts_spark/Spreader/image10.png;content/bts_spark/Spreader/image13.png;content/bts_spark/Spreader/image18.png;content/bts_spark/Spreader/image19.png;content/bts_spark/Spreader/image28.png;content/bts_spark/Spreader/image29.png;content/bts_spark/Spreader/image31.png;content/bts_spark/Spreader/image35.png;content/bts_spark/Spreader/image40.png;content/bts_spark/Spreader/image43.png;content/bts_spark/Spreader/image54.png;content/bts_spark/Spreader/image55.png;content/bts_spark/Spreader/image56.png;content/bts_spark/Spreader/image6.png;content/bts_spark/Spreader/image7.png;content/bts_spark/Spreader/image70.png;content/bts_spark/Spreader/image72.png;content/bts_spark/Spreader/image8.png;content/bts_spark/Trading/OrderTypes/index.md;content/bts_spark/Trading/_index.md;content/bts_spark/Trading/algo_studio.png;content/bts_spark/Trading/collapse_all_icon.png;content/bts_spark/Trading/cover_algo_control.png;content/bts_spark/Trading/expand_all_icon.png;content/bts_spark/Trading/image1.png;content/bts_spark/Trading/image17.png;content/bts_spark/Trading/image2.png;content/bts_spark/Trading/image25.png;content/bts_spark/Trading/image27.png;content/bts_spark/Trading/image33.png;content/bts_spark/Trading/image42.png;content/bts_spark/Trading/image44.png;content/bts_spark/Trading/image47.png;content/bts_spark/Trading/image48.png;content/bts_spark/Trading/image5.png;content/bts_spark/Trading/image50.png;content/bts_spark/Trading/image52.png;content/bts_spark/Trading/image57.png;content/bts_spark/Trading/image59.png;content/bts_spark/Trading/image60.png;content/bts_spark/Trading/image61.png;content/bts_spark/Trading/image62.png;content/bts_spark/Trading/image73.png;content/bts_spark/Trading/image74.png;content/bts_spark/Trading/join_algo_control.png;content/bts_spark/Trading/ladder.png;content/bts_spark/Trading/ladder_badges.png;content/bts_spark/Trading/ladder_main_part.png;content/bts_spark/Trading/lean_algo_control.png;content/bts_spark/Trading/mini_orderbook.png;content/bts_spark/Trading/oco_algo_control.png;content/bts_spark/Trading/offset_algo_control.png;content/bts_spark/Trading/pnl_calculation.png;content/bts_spark/Trading/pnl_window.png;content/bts_spark/Trading/recreate_icon.png;content/bts_spark/Trading/settings_icon.png;content/bts_spark/Trading/spark_menu_order_book.png;content/bts_spark/Trading/top_algo_control.png;content/bts_spark/Trading/trigger_algo_control.png;content/bts_spark/_index.md;content/release_notes/_index.md;content/system_requirements/_index.md;static/book.js;static/favicon.ico;static/image.js;templates/index.html;templates/page.html;templates/section.html;templates/shortcodes/back_button.html)
|
||||
set(sources /home/eric/spark/doc/user/build.sh;content/_index.md;content/bts_spark/Glossary/_index.md;content/bts_spark/Help/_index.md;content/bts_spark/Help/about_spark.png;content/bts_spark/Help/image39.png;content/bts_spark/Help/image58.png;content/bts_spark/Launcher/_index.md;content/bts_spark/Launcher/image38.png;content/bts_spark/Launcher/image68.png;content/bts_spark/Logging-In-to-the-System/_index.md;content/bts_spark/Logging-In-to-the-System/image3.png;content/bts_spark/Logging-In-to-the-System/image64.png;content/bts_spark/Market/_index.md;content/bts_spark/Market/change_securities.png;content/bts_spark/Market/image11.png;content/bts_spark/Market/image14.png;content/bts_spark/Market/image20.png;content/bts_spark/Market/image21.png;content/bts_spark/Market/image23.png;content/bts_spark/Market/image24.png;content/bts_spark/Market/image34.png;content/bts_spark/Market/image49.png;content/bts_spark/Market/image53.png;content/bts_spark/Market/image66.png;content/bts_spark/Market/image69.png;content/bts_spark/Market/market_view.png;content/bts_spark/Market/settings_icon.png;content/bts_spark/Market/time_and_sales.png;content/bts_spark/My-Windows/_index.md;content/bts_spark/My-Windows/image15.png;content/bts_spark/My-Windows/image16.png;content/bts_spark/My-Windows/image37.png;content/bts_spark/Settings/_index.md;content/bts_spark/Settings/image51.png;content/bts_spark/Settings/image9.png;content/bts_spark/Spreader/_index.md;content/bts_spark/Spreader/image10.png;content/bts_spark/Spreader/image13.png;content/bts_spark/Spreader/image18.png;content/bts_spark/Spreader/image19.png;content/bts_spark/Spreader/image28.png;content/bts_spark/Spreader/image29.png;content/bts_spark/Spreader/image31.png;content/bts_spark/Spreader/image35.png;content/bts_spark/Spreader/image40.png;content/bts_spark/Spreader/image43.png;content/bts_spark/Spreader/image54.png;content/bts_spark/Spreader/image55.png;content/bts_spark/Spreader/image56.png;content/bts_spark/Spreader/image6.png;content/bts_spark/Spreader/image7.png;content/bts_spark/Spreader/image70.png;content/bts_spark/Spreader/image72.png;content/bts_spark/Spreader/image8.png;content/bts_spark/Trading/OrderTypes/index.md;content/bts_spark/Trading/_index.md;content/bts_spark/Trading/algo_studio.png;content/bts_spark/Trading/collapse_all_icon.png;content/bts_spark/Trading/cover_algo_control.png;content/bts_spark/Trading/expand_all_icon.png;content/bts_spark/Trading/image1.png;content/bts_spark/Trading/image17.png;content/bts_spark/Trading/image2.png;content/bts_spark/Trading/image25.png;content/bts_spark/Trading/image27.png;content/bts_spark/Trading/image33.png;content/bts_spark/Trading/image42.png;content/bts_spark/Trading/image44.png;content/bts_spark/Trading/image47.png;content/bts_spark/Trading/image48.png;content/bts_spark/Trading/image5.png;content/bts_spark/Trading/image50.png;content/bts_spark/Trading/image52.png;content/bts_spark/Trading/image57.png;content/bts_spark/Trading/image59.png;content/bts_spark/Trading/image60.png;content/bts_spark/Trading/image61.png;content/bts_spark/Trading/image62.png;content/bts_spark/Trading/image73.png;content/bts_spark/Trading/image74.png;content/bts_spark/Trading/join_algo_control.png;content/bts_spark/Trading/ladder.png;content/bts_spark/Trading/ladder_badges.png;content/bts_spark/Trading/ladder_main_part.png;content/bts_spark/Trading/lean_algo_control.png;content/bts_spark/Trading/mini_orderbook.png;content/bts_spark/Trading/oco_algo_control.png;content/bts_spark/Trading/offset_algo_control.png;content/bts_spark/Trading/pnl_calculation.png;content/bts_spark/Trading/pnl_window.png;content/bts_spark/Trading/recreate_icon.png;content/bts_spark/Trading/settings_icon.png;content/bts_spark/Trading/spark_menu_order_book.png;content/bts_spark/Trading/top_algo_control.png;content/bts_spark/Trading/trigger_algo_control.png;content/bts_spark/_index.md;content/release_notes/_index.md;content/system_requirements/_index.md;static/book.js;static/favicon.ico;static/image.js;templates/index.html;templates/page.html;templates/section.html;templates/shortcodes/back_button.html)
|
||||
@@ -1 +1 @@
|
||||
set(sources files/cert_secure_logon.txt;files/futures.coconut.xz;files/onixs_ice/ConnectivityConfiguration.APITest.xml;files/onixs_ice/ConnectivityConfiguration.PerfTest.xml;files/onixs_ice/ConnectivityConfiguration.Production.xml;files/perf_trace/compiled.css;files/perf_trace/index.html;files/perf_trace/jquery-3.3.1.min.js;files/perf_trace/main.js;files/perf_trace/perf_log.sql;files/perf_trace/perf_trace_analysis.sql;files/perf_trace/plotly-latest.min.js)
|
||||
set(sources files/cert_secure_logon.txt;files/cert_secure_logon.txt.orig;files/futures.coconut.xz;files/onixs_ice/ConnectivityConfiguration.APITest.xml;files/onixs_ice/ConnectivityConfiguration.PerfTest.xml;files/onixs_ice/ConnectivityConfiguration.Production.xml;files/perf_trace/compiled.css;files/perf_trace/index.html;files/perf_trace/jquery-3.3.1.min.js;files/perf_trace/main.js;files/perf_trace/perf_log.sql;files/perf_trace/perf_trace_analysis.sql;files/perf_trace/plotly-latest.min.js)
|
||||
@@ -51,7 +51,8 @@ void dispatch_message(H& handler, const FramingHeader* header, const char* data)
|
||||
case 535: handle<H, OrderCancelReject535>(handler, data, header->message_size); break;
|
||||
case 536: handle<H, OrderCancelReplaceReject536>(handler, data, header->message_size); break;
|
||||
// case 538: handle<H, PartyDetailsListReport538>(handler, data, header->message_size); break;
|
||||
case 539: handle<H, ExecutionAck539>(handler, data, header->message_size); break;
|
||||
// The Execution Acknowledgment message notifies CME that a given fill has either been accepted or rejected by a counterparty for EU bilateral trades.
|
||||
// case 539: handle<H, ExecutionAck539>(handler, data, header->message_size); break;
|
||||
// case 544: handle<H, NewOrderCross544>(handler, data, header->message_size); break;
|
||||
// case 545: handle<H, MassQuoteAck545>(handler, data, header->message_size); break;
|
||||
// case 546: handle<H, RequestForQuoteAck546>(handler, data, header->message_size); break;
|
||||
@@ -64,6 +65,27 @@ void dispatch_message(H& handler, const FramingHeader* header, const char* data)
|
||||
}
|
||||
}
|
||||
|
||||
template <class H>
|
||||
void dispatch_execution_reports(H& handler, const FramingHeader* header, const char* data) {
|
||||
using namespace iLinkBinary;
|
||||
bts_assert_d(header->encoding_type == 0XCAFE);
|
||||
MessageHeader mheader {
|
||||
(char*)data, sizeof(FramingHeader), header->message_size,
|
||||
MessageHeader::sbeSchemaVersion() };
|
||||
|
||||
switch(mheader.templateId()) {
|
||||
case 522: handle<H, ExecutionReportNew522>(handler, data, header->message_size); break;
|
||||
case 523: handle<H, ExecutionReportReject523>(handler, data, header->message_size); break;
|
||||
case 524: handle<H, ExecutionReportElimination524>(handler, data, header->message_size); break;
|
||||
case 525: handle<H, ExecutionReportTradeOutright525>(handler, data, header->message_size); break;
|
||||
case 526: handle<H, ExecutionReportTradeSpread526>(handler, data, header->message_size); break;
|
||||
case 527: handle<H, ExecutionReportTradeSpreadLeg527>(handler, data, header->message_size); break;
|
||||
case 531: handle<H, ExecutionReportModify531>(handler, data, header->message_size); break;
|
||||
case 532: handle<H, ExecutionReportStatus532>(handler, data, header->message_size); break;
|
||||
case 534: handle<H, ExecutionReportCancel534>(handler, data, header->message_size); break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// This handler handles exchange messages for testing
|
||||
template <class H>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "IL3ExecutionReportParser.h"
|
||||
#include "IL3GeneratedFull.h"
|
||||
#include "ILink3Utils.h"
|
||||
#include "IL3Dispatcher.h"
|
||||
#include "lib/md/IntPrice.h"
|
||||
|
||||
namespace bts {
|
||||
@@ -27,8 +28,7 @@ const api::Security* IL3ExecutionReportParser::get_security(ExchangeSecurityKey
|
||||
}
|
||||
|
||||
template <class T>
|
||||
ExecutionReport* IL3ExecutionReportParser::construct(const T& msg) {
|
||||
auto* data = this->pool.construct();
|
||||
void IL3ExecutionReportParser::common(const T& msg, ExecutionReport* data) {
|
||||
// data->account_name ??
|
||||
static_assert(sizeof(OperatorID) == T::senderIDLength());
|
||||
memcpy(&data->operator_id.value(), msg.senderID(), msg.senderIDLength());
|
||||
@@ -47,11 +47,10 @@ ExecutionReport* IL3ExecutionReportParser::construct(const T& msg) {
|
||||
data->stop_price = Price { 0.0 };
|
||||
data->time_in_force = map_time_in_force(msg.timeInForce());
|
||||
data->transact_time = ExchangeTimeStamp64 { msg.transactTime() };
|
||||
return data;
|
||||
}
|
||||
|
||||
ExecutionReport* IL3ExecutionReportParser::parse(const iLinkBinary::ExecutionReportNew522& msg) {
|
||||
auto* data = construct(msg);
|
||||
bool IL3ExecutionReportParser::parse(const iLinkBinary::ExecutionReportNew522& msg, ExecutionReport* data) {
|
||||
common(msg, data);
|
||||
data->avg_price = Price { 0.0 };
|
||||
data->cfg = nullptr;
|
||||
data->cust_order_handling_inst = "";
|
||||
@@ -68,44 +67,59 @@ ExecutionReport* IL3ExecutionReportParser::parse(const iLinkBinary::ExecutionRep
|
||||
|
||||
data->order_status = api::orderman::NativeOrderStatus::NATIVE_ORDER_STATUS_NEW;
|
||||
|
||||
return data;
|
||||
return true;
|
||||
}
|
||||
ExecutionReport* IL3ExecutionReportParser::parse(const iLinkBinary::ExecutionReportReject523& msg) {
|
||||
auto* data = construct(msg);
|
||||
bool IL3ExecutionReportParser::parse(const iLinkBinary::ExecutionReportReject523& msg, ExecutionReport* data) {
|
||||
common(msg, data);
|
||||
data->order_status = api::orderman::NativeOrderStatus::NATIVE_ORDER_STATUS_REJECTED;
|
||||
return data;
|
||||
return false;
|
||||
}
|
||||
ExecutionReport* IL3ExecutionReportParser::parse(const iLinkBinary::ExecutionReportElimination524& msg) {
|
||||
auto* data = construct(msg);
|
||||
return data;
|
||||
bool IL3ExecutionReportParser::parse(const iLinkBinary::ExecutionReportElimination524& msg, ExecutionReport* data) {
|
||||
common(msg, data);
|
||||
return false;
|
||||
}
|
||||
ExecutionReport* IL3ExecutionReportParser::parse(const iLinkBinary::ExecutionReportTradeOutright525& msg) {
|
||||
auto* data = construct(msg);
|
||||
// data->order_status = api::orderman::NativeOrderStatus::NATIVE_ORDER_STATUS_FILLED;
|
||||
return data;
|
||||
bool IL3ExecutionReportParser::parse(const iLinkBinary::ExecutionReportTradeOutright525& msg, ExecutionReport* data) {
|
||||
common(msg, data);
|
||||
data->order_status = api::orderman::NativeOrderStatus::NATIVE_ORDER_STATUS_FILLED;
|
||||
return false;
|
||||
}
|
||||
ExecutionReport* IL3ExecutionReportParser::parse(const iLinkBinary::ExecutionReportTradeSpread526& msg) {
|
||||
auto* data = construct(msg);
|
||||
return data;
|
||||
bool IL3ExecutionReportParser::parse(const iLinkBinary::ExecutionReportTradeSpread526& msg, ExecutionReport* data) {
|
||||
common(msg, data);
|
||||
return false;
|
||||
}
|
||||
ExecutionReport* IL3ExecutionReportParser::parse(const iLinkBinary::ExecutionReportTradeSpreadLeg527&) {
|
||||
auto* data = pool.construct();
|
||||
return data;
|
||||
bool IL3ExecutionReportParser::parse(const iLinkBinary::ExecutionReportTradeSpreadLeg527& msg, ExecutionReport* data) {
|
||||
(void)msg;
|
||||
(void)data;
|
||||
return false;
|
||||
}
|
||||
ExecutionReport* IL3ExecutionReportParser::parse(const iLinkBinary::ExecutionReportModify531& msg) {
|
||||
auto* data = construct(msg);
|
||||
// data->order_status = api::orderman::NativeOrderStatus::NATIVE_ORDER_STATUS_FILLED;
|
||||
return data;
|
||||
bool IL3ExecutionReportParser::parse(const iLinkBinary::ExecutionReportModify531& msg, ExecutionReport* data) {
|
||||
common(msg, data);
|
||||
return false;
|
||||
}
|
||||
ExecutionReport* IL3ExecutionReportParser::parse(const iLinkBinary::ExecutionReportStatus532& msg) {
|
||||
auto* data = construct(msg);
|
||||
return data;
|
||||
bool IL3ExecutionReportParser::parse(const iLinkBinary::ExecutionReportStatus532& msg, ExecutionReport* data) {
|
||||
common(msg, data);
|
||||
return false;
|
||||
}
|
||||
ExecutionReport* IL3ExecutionReportParser::parse(const iLinkBinary::ExecutionReportCancel534& msg) {
|
||||
auto* data = construct(msg);
|
||||
bool IL3ExecutionReportParser::parse(const iLinkBinary::ExecutionReportCancel534& msg, ExecutionReport* data) {
|
||||
common(msg, data);
|
||||
data->order_status = api::orderman::NativeOrderStatus::NATIVE_ORDER_STATUS_CANCELED;
|
||||
return data;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
struct ParseHandler {
|
||||
IL3ExecutionReportParser& parser;
|
||||
ExecutionReport* result;
|
||||
bool success = false;
|
||||
template<class T>
|
||||
void handle(const T& t) { success = parser.parse(t, result); }
|
||||
};
|
||||
|
||||
bool parse_report(const std::string& data, md::SecurityOracle& oracle, ExecutionReport* result) {
|
||||
IL3ExecutionReportParser parser(&oracle);
|
||||
ParseHandler handler { parser, result };
|
||||
consume_messages(handler, data.c_str(), data.size(), dispatch_execution_reports<ParseHandler>);
|
||||
return handler.success;
|
||||
}
|
||||
|
||||
}}}//namespace
|
||||
@@ -12,7 +12,6 @@ namespace orderman {
|
||||
namespace ilink3 {
|
||||
|
||||
class IL3ExecutionReportParser {
|
||||
boost::object_pool<ExecutionReport> pool;
|
||||
btree::btree_map<ExchangeSecurityKey, const api::Security*> security_cache;
|
||||
md::SecurityOracle& oracle;
|
||||
|
||||
@@ -22,17 +21,19 @@ public:
|
||||
IL3ExecutionReportParser(md::SecurityOracle*);
|
||||
void cache(const api::Security*);
|
||||
|
||||
ExecutionReport* parse(const iLinkBinary::ExecutionReportNew522&);
|
||||
ExecutionReport* parse(const iLinkBinary::ExecutionReportReject523&);
|
||||
ExecutionReport* parse(const iLinkBinary::ExecutionReportElimination524&);
|
||||
ExecutionReport* parse(const iLinkBinary::ExecutionReportTradeOutright525&);
|
||||
ExecutionReport* parse(const iLinkBinary::ExecutionReportTradeSpread526&);
|
||||
ExecutionReport* parse(const iLinkBinary::ExecutionReportTradeSpreadLeg527&);
|
||||
ExecutionReport* parse(const iLinkBinary::ExecutionReportModify531&);
|
||||
ExecutionReport* parse(const iLinkBinary::ExecutionReportStatus532&);
|
||||
ExecutionReport* parse(const iLinkBinary::ExecutionReportCancel534&);
|
||||
bool parse(const iLinkBinary::ExecutionReportNew522&, ExecutionReport*);
|
||||
bool parse(const iLinkBinary::ExecutionReportReject523&, ExecutionReport*);
|
||||
bool parse(const iLinkBinary::ExecutionReportElimination524&, ExecutionReport*);
|
||||
bool parse(const iLinkBinary::ExecutionReportTradeOutright525&, ExecutionReport*);
|
||||
bool parse(const iLinkBinary::ExecutionReportTradeSpread526&, ExecutionReport*);
|
||||
bool parse(const iLinkBinary::ExecutionReportTradeSpreadLeg527&, ExecutionReport*);
|
||||
bool parse(const iLinkBinary::ExecutionReportModify531&, ExecutionReport*);
|
||||
bool parse(const iLinkBinary::ExecutionReportStatus532&, ExecutionReport*);
|
||||
bool parse(const iLinkBinary::ExecutionReportCancel534&, ExecutionReport*);
|
||||
|
||||
template <class T> ExecutionReport* construct(const T&);
|
||||
template <class T> void common(const T&, ExecutionReport*);
|
||||
};
|
||||
|
||||
bool parse_report(const std::string&, md::SecurityOracle&, ExecutionReport*);
|
||||
|
||||
}}}//namespace
|
||||
@@ -92,6 +92,7 @@ ILinkGW::ILinkGW(IL3Connection& con, const Session& session, const Config& conf)
|
||||
_session(session),
|
||||
_msg_count(0),
|
||||
_time(),
|
||||
_pool(),
|
||||
_exe_parser(nullptr)
|
||||
{
|
||||
if (debug_log) {
|
||||
@@ -133,6 +134,11 @@ void ILinkGW::send_negotiate() {
|
||||
msg.putAccessKeyID(ld.access_key);
|
||||
msg.putHMACSignature(ld.hmac);
|
||||
|
||||
std::string temp = ld.canonical;
|
||||
for (size_t x = 0; x < temp.size(); ++x) { if (temp[x] == '\n') temp[x] = '$'; }
|
||||
log_str(temp.c_str());
|
||||
log_str(("HMAC="+ld.signature).c_str());
|
||||
|
||||
// expect -> NegotiationResponse501 or NegotiationReject502
|
||||
log_out(msg);
|
||||
}
|
||||
@@ -383,7 +389,6 @@ void ILinkGW::send_terminate(uint16_t code) {
|
||||
|
||||
void ILinkGW::flush() {
|
||||
_buffer.flush(_connection);
|
||||
publish_session_update();
|
||||
}
|
||||
|
||||
const char* state_string(State s) {
|
||||
@@ -422,14 +427,16 @@ void ILinkGW::on_connect_success() {
|
||||
// message to register it with the CME
|
||||
_session = Session::create();
|
||||
send_negotiate();
|
||||
// Flush w/out publishing session id
|
||||
_buffer.flush(_connection);
|
||||
}
|
||||
else {
|
||||
// We only need to establish the current sequence number
|
||||
LOG(OrderMan, Info, "re-establishing existing iLink session. {}", _session.uuid);
|
||||
set_state(State::ESTABLISHING);
|
||||
send_establish();
|
||||
flush();
|
||||
}
|
||||
flush();
|
||||
}
|
||||
void ILinkGW::on_disconnect() {
|
||||
LOG(OrderMan, Error, "Disconnected.");
|
||||
@@ -459,6 +466,7 @@ void ILinkGW::handle(const iLinkBinary::NegotiationResponse501& msg) {
|
||||
// If we're receiving a NegotiateResponse we just created a session
|
||||
// Update the _session to send id 1
|
||||
bts_assert_d(_session);
|
||||
log_in(msg);
|
||||
// NegotiationResponse indicates the session was created
|
||||
publish_session_update();
|
||||
|
||||
@@ -500,6 +508,7 @@ void ILinkGW::handle(const iLinkBinary::NegotiationReject502& msg) {
|
||||
msg.errorCodes(),
|
||||
std::string(translate_negotiation_reject(msg.errorCodes())),
|
||||
to_string(msg));
|
||||
log_in(msg);
|
||||
set_state(State::ERROR);
|
||||
_connection.disconnect();
|
||||
}
|
||||
@@ -566,15 +575,11 @@ void ILinkGW::handle(const iLinkBinary::BusinessReject521& msg) {
|
||||
set_state(State::ERROR);
|
||||
}
|
||||
void ILinkGW::handle(const iLinkBinary::ExecutionReportNew522& msg) {
|
||||
auto* report = _exe_parser.parse(msg);
|
||||
if (__builtin_expect (msg.uUID(), _session.uuid)) {
|
||||
_on_exe_report(report);
|
||||
return;
|
||||
}
|
||||
else {
|
||||
// handle retransmit
|
||||
_on_replay_exe_report(report);
|
||||
}
|
||||
auto* report = _pool.construct();
|
||||
bool result = _exe_parser.parse(msg, report);
|
||||
bts_assert(result);
|
||||
_on_exe_report(report);
|
||||
log_in(msg);
|
||||
}
|
||||
void ILinkGW::handle(const iLinkBinary::ExecutionReportReject523& msg) {
|
||||
log_in(msg);
|
||||
@@ -603,9 +608,11 @@ void ILinkGW::handle(const iLinkBinary::ExecutionReportCancel534& msg) {
|
||||
log_in(msg);
|
||||
}
|
||||
void ILinkGW::handle(const iLinkBinary::OrderCancelReject535& msg) {
|
||||
// handle error?
|
||||
log_in(msg);
|
||||
}
|
||||
void ILinkGW::handle(const iLinkBinary::OrderCancelReplaceReject536& msg) {
|
||||
// handle error?
|
||||
log_in(msg);
|
||||
}
|
||||
void ILinkGW::handle(const iLinkBinary::ExecutionAck539& msg) {
|
||||
|
||||
@@ -76,6 +76,7 @@ class ILinkGW : IL3ConnectionHandler {
|
||||
std::optional<RetransmitState> _rt_session;
|
||||
uint32_t _msg_count;
|
||||
TimeKeeper _time;
|
||||
boost::object_pool<ExecutionReport> _pool;
|
||||
IL3ExecutionReportParser _exe_parser;
|
||||
|
||||
public:
|
||||
@@ -110,7 +111,10 @@ public:
|
||||
|
||||
private:
|
||||
void set_state(State);
|
||||
uint32_t next_seq() { return ++_session.to_cme; }
|
||||
uint32_t next_seq() {
|
||||
_session.to_cme += 1;
|
||||
return _session.to_cme-1;
|
||||
}
|
||||
void publish_session_update() { _on_session_change(_session); }
|
||||
|
||||
void on_connect_success() override;
|
||||
|
||||
@@ -1 +1 @@
|
||||
set(sources ../../externals/linux/include/google/protobuf/descriptor.proto;../../externals/linux/include/google/protobuf/timestamp.proto;../lib/api/apicore.proto;../lib/api/apigateway.proto;../lib/api/apioptions.proto;../lib/api/services/AdminService.proto;../lib/api/services/AlgoDefinitionService.proto;../lib/api/services/AlgoService.proto;../lib/api/services/ApiUnitTestService.proto;../lib/api/services/AuthService.proto;../lib/api/services/BasePositionService.proto;../lib/api/services/ErrorReportService.proto;../lib/api/services/HelloService.proto;../lib/api/services/MBOService.proto;../lib/api/services/MarginService.proto;../lib/api/services/MarketDataAuxiliaryService.proto;../lib/api/services/MarketDataRelay.proto;../lib/api/services/MarketDataService.proto;../lib/api/services/MoneyFileService.proto;../lib/api/services/OrderService.proto;../lib/api/services/OutOfProcessURLListener.proto;../lib/api/services/PersistenceService.proto;../lib/api/services/PositionService.proto;../lib/api/services/ShellDiagnosticService.proto;../lib/api/services/ShellLatencyService.proto;../lib/api/services/SyntheticSecurityService.proto;../lib/domain_model/Security.proto;../lib/md/protos/co2.proto;../lib/sparkproto/SparkProtos.proto;api/build.sh;api/quiet_build.sh;api/src/DynamicService.ts;api/src/ServiceContext.ts;api/src/bts_assert.ts;ui/src/Access.fs;ui/src/Accounts/ClipLimits.fs;ui/src/Accounts/ProductLimits.fs;ui/src/Accounts/SecurityLimits.fs;ui/src/Accounts/State.fs;ui/src/Accounts/Types.fs;ui/src/Accounts/View.fs;ui/src/App.fs;ui/src/Cmd.fs;ui/src/Controls/Button.fs;ui/src/Controls/DataGrid.fs;ui/src/Controls/Fields.fs;ui/src/Controls/Modal.fs;ui/src/Controls/ReactGrid.fs;ui/src/Controls/Table.fs;ui/src/Controls/nbsp.fs;ui/src/Global.fs;ui/src/Imports.fs;ui/src/Lens.fs;ui/src/Login/Login.fs;ui/src/Nav.fs;ui/src/State.fs;ui/src/Types.fs;ui/src/Users/State.fs;ui/src/Users/Types.fs;ui/src/Users/View.fs;ui/src/Util/EnumUtils.fs;ui/src/Util/JSMap.fs;ui/src/Util/StreamUtils.fs;ui/src/obj/Debug/netstandard2.0/ui.AssemblyInfo.fs)
|
||||
set(sources ../../externals/linux/include/google/protobuf/descriptor.proto;../../externals/linux/include/google/protobuf/timestamp.proto;../lib/api/apicore.proto;../lib/api/apigateway.proto;../lib/api/apioptions.proto;../lib/api/services/AdminService.proto;../lib/api/services/AlgoDefinitionService.proto;../lib/api/services/AlgoService.proto;../lib/api/services/ApiUnitTestService.proto;../lib/api/services/AuthService.proto;../lib/api/services/BasePositionService.proto;../lib/api/services/ErrorReportService.proto;../lib/api/services/HelloService.proto;../lib/api/services/MBOService.proto;../lib/api/services/MarginService.proto;../lib/api/services/MarketDataAuxiliaryService.proto;../lib/api/services/MarketDataRelay.proto;../lib/api/services/MarketDataService.proto;../lib/api/services/MoneyFileService.proto;../lib/api/services/OrderService.proto;../lib/api/services/OutOfProcessURLListener.proto;../lib/api/services/PersistenceService.proto;../lib/api/services/PositionService.proto;../lib/api/services/ShellDiagnosticService.proto;../lib/api/services/ShellLatencyService.proto;../lib/api/services/SyntheticSecurityService.proto;../lib/domain_model/Security.proto;../lib/md/protos/co2.proto;../lib/sparkproto/SparkProtos.proto;api/build.sh;api/node_modules/exit/test/fixtures/create-files.sh;api/node_modules/object.assign/test.sh;api/node_modules/protobufjs/cli/node_modules/acorn-jsx/node_modules/acorn/bin/update_authors.sh;api/node_modules/watch/release.sh;api/quiet_build.sh;api/src/DynamicService.ts;api/src/ServiceContext.ts;api/src/bts_assert.ts;ui/src/Access.fs;ui/src/Accounts/ClipLimits.fs;ui/src/Accounts/ProductLimits.fs;ui/src/Accounts/SecurityLimits.fs;ui/src/Accounts/State.fs;ui/src/Accounts/Types.fs;ui/src/Accounts/View.fs;ui/src/App.fs;ui/src/Cmd.fs;ui/src/Controls/Button.fs;ui/src/Controls/DataGrid.fs;ui/src/Controls/Fields.fs;ui/src/Controls/Modal.fs;ui/src/Controls/ReactGrid.fs;ui/src/Controls/Table.fs;ui/src/Controls/nbsp.fs;ui/src/Global.fs;ui/src/Imports.fs;ui/src/Lens.fs;ui/src/Login/Login.fs;ui/src/Nav.fs;ui/src/State.fs;ui/src/Types.fs;ui/src/Users/State.fs;ui/src/Users/Types.fs;ui/src/Users/View.fs;ui/src/Util/EnumUtils.fs;ui/src/Util/JSMap.fs;ui/src/Util/StreamUtils.fs)
|
||||
Reference in new issue
Block a user