connect to deployed backend

This commit is contained in:
sfja 2026-04-09 16:00:19 +02:00
parent 9a15a14943
commit 1f31cfb561
2 changed files with 4 additions and 6 deletions

View File

@ -388,7 +388,7 @@ impl ShapeGroup {
fn main() -> Result<(), Box<dyn std::error::Error>> { fn main() -> Result<(), Box<dyn std::error::Error>> {
let t = thread::spawn(|| { let t = thread::spawn(|| {
let mut server = Server::new().unwrap(); let mut server = Server::new("10.133.51.127:8888").unwrap();
server server
.subscribe(|measurement| { .subscribe(|measurement| {
println!("angle = {}", measurement.angle); println!("angle = {}", measurement.angle);

View File

@ -1,9 +1,7 @@
use std::{ use std::{
io::{self, BufReader, Read, Write}, io::{self, Read, Write},
net::TcpStream, net::TcpStream,
slice::{from_raw_parts, from_raw_parts_mut}, slice::{from_raw_parts, from_raw_parts_mut},
thread,
time::Duration,
}; };
#[repr(C)] #[repr(C)]
@ -26,9 +24,9 @@ pub struct Server {
} }
impl Server { impl Server {
pub fn new() -> io::Result<Self> { pub fn new(host: &str) -> io::Result<Self> {
Ok(Self { Ok(Self {
stream: TcpStream::connect("127.0.0.1:8889")?, stream: TcpStream::connect(host)?,
}) })
} }