itch-mold-replay 1.0
Time-accurate NASDAQ TotalView-ITCH 5.0 replay over MoldUDP64
Loading...
Searching...
No Matches
imr Namespace Reference

Namespaces

namespace  mold
 
namespace  util
 

Classes

class  Server
 A MoldUDP64 server that replays NASDAQ TotalView-ITCH 5.0 files. More...
 

Functions

std::expected< std::unique_ptr< Server >, std::string > make_server (const Server::Config &cfg) noexcept
 Allows you to construct server without try/catch block to handle configuration errors.
 

Detailed Description

ndi * // construct directly with try/catch
try
{
Server server(cfg);
server.start();
server.wait_for_downstream();
}
catch (const std::exception& ex)
{
std::println("{}", ex.what());
}
// or use helper that catches and returns std::expected
const std::expected res{imr::make_server(cfg)};
if (!res.has_value())
{
std::println(stderr, "{}", res.error());
}
std::unique_ptr<imr::Server> server{*res};
server->start();
server->wait_for_downstream();
std::expected< std::unique_ptr< Server >, std::string > make_server(const Server::Config &cfg) noexcept
Allows you to construct server without try/catch block to handle configuration errors.
Aggregate for configuration of all server components.
Definition server.h:64

Function Documentation

◆ make_server()

std::expected< std::unique_ptr< Server >, std::string > imr::make_server ( const Server::Config cfg)
noexcept

Allows you to construct server without try/catch block to handle configuration errors.

At the moment just returns a string describing the error, so you can print and see what went wrong.