Skip to content

Commit

Permalink
🔊 Update REPL logs
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurlm committed Nov 14, 2023
1 parent 628c548 commit 598126f
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions quickfix/examples/fix_repl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,34 +30,36 @@ fn main() {

match connect_mode.as_str() {
"initiator" => {
let mut connection_handler =
let connection_handler =
SocketInitiator::try_new(&settings, &app, &store_factory, &log_factory)
.expect("Fail to build connection handler");

server_loop(&mut connection_handler);
server_loop(connection_handler);
}
"acceptor" => {
let mut connection_handler =
let connection_handler =
SocketAcceptor::try_new(&settings, &app, &store_factory, &log_factory)
.expect("Fail to build connection handler");

server_loop(&mut connection_handler);
server_loop(connection_handler);
}
_ => {
eprintln!("Invalid connection mode");
exit(1);
}
}

println!(">> All cleared. Bye !");
}

fn server_loop<C: ConnectionHandler>(connection_handler: &mut C) {
fn server_loop<C: ConnectionHandler>(mut connection_handler: C) {
println!(">> connection handler START");
connection_handler
.start()
.expect("Fail to start connection handler");

let mut shell = FixShell::new();
shell.repl(connection_handler);
shell.repl(&mut connection_handler);

println!(">> connection handler STOP");
connection_handler
Expand Down

0 comments on commit 598126f

Please sign in to comment.