Skip to content

Commit

Permalink
Keep connections after commands (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
xunmod authored Jan 22, 2025
1 parent 94d899b commit a879088
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -368,8 +368,7 @@ async fn handle_stream(
let res: Vec<u8> = res.into();
socket.write_all(&res).await.unwrap();

// No more further communication for this packet
return;
continue;
}
"Listen" => {
// The full functionality of this is not implemented. We will just maintain the connection.
Expand Down Expand Up @@ -400,8 +399,7 @@ async fn handle_stream(
let res: Vec<u8> = res.into();
socket.write_all(&res).await.unwrap();

// No more further communication for this packet
return;
continue;
}
"ReadBUID" => {
let lock = data.lock().await;
Expand All @@ -414,8 +412,7 @@ async fn handle_stream(
let res: Vec<u8> = res.into();
socket.write_all(&res).await.unwrap();

// No more further communication for this packet
return;
continue;
}
"Connect" => {
let connection_port = match parsed.plist.get("PortNumber") {
Expand Down Expand Up @@ -480,7 +477,7 @@ async fn handle_stream(
{
info!("Bidirectional stream stopped: {e:?}");
}
return;
continue;
}
Err(e) => {
error!("Unable to connect to device {device_id} port {connection_port}: {e:?}");
Expand All @@ -492,7 +489,7 @@ async fn handle_stream(
let res: Vec<u8> = res.into();
socket.write_all(&res).await.unwrap();

return;
continue;
}
}
}
Expand All @@ -509,7 +506,7 @@ async fn handle_stream(
let res: Vec<u8> = res.into();
socket.write_all(&res).await.unwrap();

return;
continue;
}
}
_ => {
Expand Down

0 comments on commit a879088

Please sign in to comment.