diff --git a/src/com/telnet.rs b/src/com/telnet.rs index 9e0389f..79ad544 100644 --- a/src/com/telnet.rs +++ b/src/com/telnet.rs @@ -492,7 +492,8 @@ impl Com for ComTelnetImpl { } fn read_data(&mut self) -> TermComResult>> { - let mut buf = [0; 1024 * 256]; + let mut buf: [u8; 262144] = [0; 1024 * 256]; + self.tcp_stream.set_nonblocking(true)?; match self.tcp_stream.read(&mut buf) { Ok(size) => { if size == 0 { diff --git a/src/ui/buffer_update_thread.rs b/src/ui/buffer_update_thread.rs index 793a5d8..769ef39 100644 --- a/src/ui/buffer_update_thread.rs +++ b/src/ui/buffer_update_thread.rs @@ -68,7 +68,7 @@ impl BufferUpdateThread { fn update_buffer(&mut self, ctx: &egui::Context, buffer_parser: &mut dyn BufferParser, data: &[u8]) -> (u64, usize) { let has_data = !data.is_empty(); if !data.is_empty() { - // println!("data : {} {}", self.last_update.elapsed().as_millis(), data.len()); + println!("data : {} {}", data.len(), self.enabled); } if !self.enabled { return (10, 0); diff --git a/src/ui/com_thread.rs b/src/ui/com_thread.rs index dbc3fab..cabf415 100644 --- a/src/ui/com_thread.rs +++ b/src/ui/com_thread.rs @@ -42,7 +42,7 @@ impl ConnectionThreadData { Ok(Some(data)) => { if self.baud_rate == 0 { if let Err(err) = self.tx.send(SendData::Data(data)) { - log::error!("connection_thread::read_data: {err}"); + log::error!("connection_thread::read_data1: {err}"); self.thread_is_running &= self.tx.send(SendData::Disconnect).is_ok(); } } else { @@ -52,14 +52,14 @@ impl ConnectionThreadData { Ok(None) => return false, Err(err) => { - log::error!("connection_thread::read_data: {err}"); + log::error!("connection_thread::read_data2: {err}"); self.disconnect(); return false; } } } else if self.baud_rate == 0 { if let Err(err) = self.tx.send(SendData::Data(self.data_buffer.drain(..).collect())) { - log::error!("connection_thread::read_data: {err}"); + log::error!("connection_thread::read_data3: {err}"); self.thread_is_running &= self.tx.send(SendData::Disconnect).is_ok(); self.disconnect(); }