From 6fa6c31581b0a1b284d1e261a52eeb0823d71512 Mon Sep 17 00:00:00 2001 From: poslop Date: Fri, 13 Jan 2023 16:09:09 -0600 Subject: [PATCH] fix search command --- src/mindus.rs | 1 + src/structs.rs | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/mindus.rs b/src/mindus.rs index 41482ee..aef6fde 100644 --- a/src/mindus.rs +++ b/src/mindus.rs @@ -23,6 +23,7 @@ pub fn cons_rw(sock: &TcpSock, input: &str) -> String { Err(_) => break(), }; } + output.clear(); writer.write((input.to_owned() + "\n").as_bytes()).unwrap(); diff --git a/src/structs.rs b/src/structs.rs index 1c551c7..53b020f 100644 --- a/src/structs.rs +++ b/src/structs.rs @@ -10,7 +10,7 @@ pub struct TcpSock { impl TcpSock { pub fn new(ip: String, port: String) -> std::io::Result { let stream = TcpStream::connect(format!("{}:{}", ip, port)).expect("Tcp connection fail"); - stream.set_read_timeout(Some(Duration::from_millis(25)))?; + stream.set_read_timeout(Some(Duration::from_millis(100)))?; println!("Socket Connected!!"); Ok(TcpSock { stream }) } @@ -50,4 +50,4 @@ pub struct AdminConsole { impl TypeMapKey for Config { type Value = Config; -} \ No newline at end of file +}