make AtemSocket{,Inner} take a socketaddr at init time

This commit is contained in:
2025-06-12 18:34:09 +01:00
parent a419a78a0a
commit 2ec4c231c2
3 changed files with 18 additions and 32 deletions
+6 -3
View File
@@ -1,4 +1,4 @@
use std::time::Duration;
use std::{env::args, net::Ipv4Addr, time::Duration};
use atem_connection_rs::{
atem_lib::atem_socket::AtemSocket,
@@ -18,8 +18,11 @@ async fn main() {
let switch_to_source_1 = ProgramInput::new(0, 1);
let switch_to_source_2 = ProgramInput::new(0, 2);
let mut atem = AtemSocket::new();
atem.connect("127.0.0.1".to_string(), 9910).await.ok();
let mut atem = AtemSocket::new((
args().skip(1).next().unwrap().parse::<Ipv4Addr>().unwrap(),
9910,
));
atem.connect().await.ok();
let mut tracking_id = 0;
loop {