mirror of
https://github.com/Mercantec-GHC/h5-projekt-mst.git
synced 2026-08-26 21:27:38 +02:00
connect to deployed backend
This commit is contained in:
parent
9a15a14943
commit
1f31cfb561
@ -388,7 +388,7 @@ impl ShapeGroup {
|
||||
|
||||
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
let t = thread::spawn(|| {
|
||||
let mut server = Server::new().unwrap();
|
||||
let mut server = Server::new("10.133.51.127:8888").unwrap();
|
||||
server
|
||||
.subscribe(|measurement| {
|
||||
println!("angle = {}", measurement.angle);
|
||||
|
||||
@ -1,9 +1,7 @@
|
||||
use std::{
|
||||
io::{self, BufReader, Read, Write},
|
||||
io::{self, Read, Write},
|
||||
net::TcpStream,
|
||||
slice::{from_raw_parts, from_raw_parts_mut},
|
||||
thread,
|
||||
time::Duration,
|
||||
};
|
||||
|
||||
#[repr(C)]
|
||||
@ -26,9 +24,9 @@ pub struct Server {
|
||||
}
|
||||
|
||||
impl Server {
|
||||
pub fn new() -> io::Result<Self> {
|
||||
pub fn new(host: &str) -> io::Result<Self> {
|
||||
Ok(Self {
|
||||
stream: TcpStream::connect("127.0.0.1:8889")?,
|
||||
stream: TcpStream::connect(host)?,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user