jojo/improvements #2

Merged
neelix merged 2 commits from jojo/improvements into master 2024-12-30 19:39:07 +01:00
Showing only changes of commit baee4ab135 - Show all commits

View File

@@ -1,23 +0,0 @@
pub struct FlutR {
stream: TcpStream,
msgs: PixelMsgs,
}
impl FlutR {
fn new(host: Host, port: u16, msgs: PixelMsgs) -> Result<Self, std::io::Error> {
let stream = TcpStream::connect(format!("{host}:{port}"))?;
Ok(FlutR { stream, msgs })
}
fn flut(&mut self) {
for msg in self.msgs.clone() {
dbg!(&msg);
let result = self.stream.write(msg.as_str().as_bytes());
match result {
Ok(_) => (),
Err(err) => eprintln!("{err}"),
}
let _ = self.stream.flush();
}
}
}