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>> {
|
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);
|
||||||
|
|||||||
@ -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)?,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user