Skip to content

Commit

Permalink
Don't fail upon not being able to launch RLViser
Browse files Browse the repository at this point in the history
  • Loading branch information
VirxEC committed Jun 14, 2023
1 parent 7b2551b commit 06e7b72
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rlviser-py"
version = "0.2.1"
version = "0.2.2"
edition = "2021"
description = "Python implementation that manages a UDP connection to RLViser"
license = "MIT"
Expand Down
6 changes: 4 additions & 2 deletions src/socket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@ static SOCKET: RwLock<Lazy<(UdpSocket, SocketAddr)>> = RwLock::new(Lazy::new(||

pub fn init() -> io::Result<(UdpSocket, SocketAddr)> {
// launch RLViser
Command::new(RLVISER_PATH).spawn()?;
if let Err(e) = Command::new(RLVISER_PATH).spawn() {
println!("Failed to launch RLViser ({RLVISER_PATH}): {e}");
}

// Connect to RLViser
let socket = UdpSocket::bind("0.0.0.0:34254")?;

println!("Waiting for RLViser to connect...");
println!("Waiting for connection to socket...");
let mut buf = [0; 1];
let (_, src) = socket.recv_from(&mut buf)?;

Expand Down

0 comments on commit 06e7b72

Please sign in to comment.