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 +}