Meaningless autocert code
This commit is contained in:
1 parent
8d7f1738cf
commit
3231ffb343
1 file changed
+22
-72
@@ -225,10 +225,28 @@ private:
|
||||
|
||||
public:
|
||||
|
||||
void msgw_failover() {
|
||||
void connection_with_gt_orders(int step) {
|
||||
bootup();
|
||||
std::vector<const ExecutionReport*> reports;
|
||||
gw.subscribe_execution_reports([&](const ExecutionReport* r) {
|
||||
reports.push_back(r);
|
||||
});
|
||||
|
||||
if (step == 1) {
|
||||
// Test retransmit
|
||||
auto order = createOrderDefault();
|
||||
order.time_in_force = api::orderman::TimeInForce::TIME_IN_FORCE_GTC;
|
||||
send_order(order);
|
||||
}
|
||||
else if (step == 2) {
|
||||
gw.send_sequence();
|
||||
gw.flush();
|
||||
run();
|
||||
}
|
||||
|
||||
interactive_delay();
|
||||
}
|
||||
|
||||
// todo
|
||||
void manage_maximum_quantity_display2() {
|
||||
LOG(OrderMan, Info, " Manage Maximum Quantity Display with Cancel-Replace for On-Demand Format ");
|
||||
bootup();
|
||||
@@ -246,7 +264,7 @@ private:
|
||||
order.display_quantity = Quantity { order.display_quantity.value() + 1 };
|
||||
send_modify(order, reports.back());
|
||||
interactive_delay();
|
||||
order.display_quantity = Quantity { order.display_quantity.value() + 1 };
|
||||
order.display_quantity = Quantity { order.display_quantity.value() - 1 };
|
||||
send_modify(order, reports.back());
|
||||
run();
|
||||
}
|
||||
@@ -529,7 +547,7 @@ int CMECert::execute(const std::vector<std::string>&) {
|
||||
//
|
||||
///////////////////////////
|
||||
|
||||
run.manage_maximum_quantity_display2();
|
||||
run.connection_with_gt_orders();
|
||||
|
||||
///////////////////////////
|
||||
//
|
||||
@@ -543,7 +561,6 @@ int CMECert::execute(const std::vector<std::string>&) {
|
||||
}
|
||||
gw.send_terminate();
|
||||
gw.flush();
|
||||
std::cout << std::endl << "We're done here.";
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -551,71 +568,4 @@ std::string CMECert::help() {
|
||||
return "Tool to drive CME Cert";
|
||||
}
|
||||
|
||||
//////////////////////////////////////////
|
||||
// This code worked once...
|
||||
//////////////////////////////////////////
|
||||
|
||||
// uint64_t determine_session() {
|
||||
// // this is fairly complex
|
||||
// // see session_name.h
|
||||
// return utils::TimeStamp::now().to_uint64();
|
||||
// }
|
||||
|
||||
// template <class Msg, size_t Data=0, size_t Sz=4+iLinkBinary::MessageHeader::encodedLength()+Msg::sbeBlockLength()>
|
||||
// std::array<char,Sz+Data> mkbuffer() {
|
||||
// static_assert(sizeof(FramingHeader) == 4);
|
||||
// return std::array<char,Sz+Data> {};
|
||||
// }
|
||||
|
||||
// template <class Msg, size_t Sz>
|
||||
// Msg frame_message(std::array<char,Sz>& buffer) {
|
||||
// static_assert(Sz >= 4+iLinkBinary::MessageHeader::encodedLength()+Msg::sbeBlockLength());
|
||||
// static_assert(sizeof(FramingHeader) == 4);
|
||||
// FramingHeader* fhead = reinterpret_cast<FramingHeader*>(&buffer[0]);
|
||||
// fhead->message_size = buffer.size();
|
||||
// fhead->encoding_type = 0xCAFE;
|
||||
// Msg msg;
|
||||
// msg.wrapAndApplyHeader((char*)&buffer, sizeof(FramingHeader), buffer.size());
|
||||
// return msg;
|
||||
// }
|
||||
|
||||
// void do_negotiate() {
|
||||
// // add 2 bytes for empty 'credentials' (39008) length
|
||||
// auto buffer = mkbuffer<iLinkBinary::Negotiate500,2>();
|
||||
// auto msg = frame_message<iLinkBinary::Negotiate500>(buffer);
|
||||
|
||||
// // msg.customerFlow(); // constant
|
||||
// // msg.hMACVersion(); // constant
|
||||
// msg.uUID(1111);
|
||||
// msg.requestTimestamp(9999);
|
||||
// msg.putSession("NGG");
|
||||
// // sets the length of the credential block to ushort 00
|
||||
// msg.putCredentials("");
|
||||
// // pad with 0 at the front *and* null at the back
|
||||
// const std::string_view firm = "004";
|
||||
// // this must use the std::string_view overload
|
||||
// // the char* overload does not pad correctly
|
||||
// msg.putFirm(firm);
|
||||
// const auto ld = glbx::calculate_hmac(
|
||||
// msg.getSessionAsString(),
|
||||
// std::to_string(msg.requestTimestamp()),
|
||||
// std::to_string(msg.uUID()),
|
||||
// msg.getSessionAsString(),
|
||||
// firm.data()
|
||||
// );
|
||||
// msg.putAccessKeyID(ld.access_key);
|
||||
// msg.putHMACSignature(ld.hmac);
|
||||
|
||||
// // connection->send({ buffer.data(), buffer.size() });
|
||||
|
||||
// auto fd = fopen("/home/eric/old.bin", "wb");
|
||||
// if (fd) {
|
||||
// fwrite(buffer.data(), 1, buffer.size(), fd);
|
||||
// fclose(fd);
|
||||
// }
|
||||
// }
|
||||
|
||||
//////////////////////////////////////////
|
||||
// This code worked once
|
||||
//////////////////////////////////////////
|
||||
}}//namespace
|
||||
Reference in new issue
Block a user