Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5cd3a710bd | ||
|
|
7c4daa0f4b |
No files matched your search
@@ -19,6 +19,7 @@
|
||||
#include <fmt/format.h>
|
||||
#include <fstream>
|
||||
#include <thread>
|
||||
#include <regex>
|
||||
|
||||
namespace bts {
|
||||
namespace jetfix {
|
||||
@@ -113,6 +114,13 @@ std::string store_path(std::string base_path,
|
||||
return result.string();
|
||||
}
|
||||
|
||||
bool is_valid_store_line(std::string const&line) {
|
||||
std::regex rx("\\d\\d\\d\\d\\d\\d\\d\\d-"
|
||||
"\\d\\d:\\d\\d:\\d\\d\\."
|
||||
"\\d\\d\\d . 8=FIX\\.4\\.2.*");
|
||||
return std::regex_match(line, rx);
|
||||
}
|
||||
|
||||
std::map<uint32_t, InMsgBuffer>
|
||||
load_replay(config::JetFIX::Connection const &cfg, std::string const &path,
|
||||
uint32_t ) {
|
||||
@@ -122,13 +130,14 @@ load_replay(config::JetFIX::Connection const &cfg, std::string const &path,
|
||||
std::ifstream f(path);
|
||||
std::string line_buffer;
|
||||
line_buffer.reserve(10 * 1024);
|
||||
auto header_size = sizeof("20150427-19:05:17.032 < ") - 1;
|
||||
std::string date_buffer("20150427-19:05:17.032");
|
||||
|
||||
for (;;) {
|
||||
std::getline(f, line_buffer);
|
||||
if (!f.eof()) {
|
||||
bts_assert(line_buffer.size() > header_size);
|
||||
if (!is_valid_store_line(line_buffer))
|
||||
continue;
|
||||
|
||||
if (line_buffer[22] == '<') {
|
||||
auto ts =
|
||||
datetime::parse_FIX_timestamp(line_buffer.substr(0, 21));
|
||||
|
||||
@@ -29,4 +29,6 @@ private:
|
||||
std::unique_ptr<PImpl> me;
|
||||
};
|
||||
|
||||
bool is_valid_store_line(std::string const&) ;
|
||||
|
||||
}}
|
||||
@@ -192,6 +192,10 @@ void ICEExecutionGateway::on_trader_login_timeout_expired()
|
||||
{
|
||||
if(u.has_user_data() && u.user_data().has_exchange_user_data() && u.user_data().exchange_user_data().has_ice_data())
|
||||
{
|
||||
if(!u.is_present())
|
||||
continue;
|
||||
if(!u.is_active())
|
||||
continue;
|
||||
const auto& ice = u.user_data().exchange_user_data().ice_data();
|
||||
if(auth_traders.find(ice.authorized_trader()) == auth_traders.end())
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user