Public dry run dryrun-75438361f386
Source commit: 75438361f3867d6802c132c8cde99834e2c107ed Public tree identity: sha256:6f1720ab7bffa98e56eb700fb376202dad8b7fbc546ef1446912c9d0fa42a17d
This commit is contained in:
commit
ded7d5a949
102 changed files with 31701 additions and 0 deletions
22
crates/disasmer-coordinator/src/main.rs
Normal file
22
crates/disasmer-coordinator/src/main.rs
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
use std::io::Write;
|
||||
|
||||
use disasmer_coordinator::{service::bind_listener, CoordinatorService};
|
||||
use serde_json::json;
|
||||
|
||||
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
let mut listen = "127.0.0.1:0".to_owned();
|
||||
let mut args = std::env::args().skip(1);
|
||||
while let Some(arg) = args.next() {
|
||||
if arg == "--listen" {
|
||||
listen = args.next().ok_or("--listen requires an address")?;
|
||||
}
|
||||
}
|
||||
|
||||
let (listener, addr) = bind_listener(&listen)?;
|
||||
println!("{}", json!({ "listen": addr.to_string() }));
|
||||
std::io::stdout().flush()?;
|
||||
|
||||
let service = CoordinatorService::new(1);
|
||||
service.serve_tcp(listener)?;
|
||||
Ok(())
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue