fix search command
This commit is contained in:
@@ -23,6 +23,7 @@ pub fn cons_rw(sock: &TcpSock, input: &str) -> String {
|
|||||||
Err(_) => break(),
|
Err(_) => break(),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
output.clear();
|
output.clear();
|
||||||
|
|
||||||
writer.write((input.to_owned() + "\n").as_bytes()).unwrap();
|
writer.write((input.to_owned() + "\n").as_bytes()).unwrap();
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ pub struct TcpSock {
|
|||||||
impl TcpSock {
|
impl TcpSock {
|
||||||
pub fn new(ip: String, port: String) -> std::io::Result<Self> {
|
pub fn new(ip: String, port: String) -> std::io::Result<Self> {
|
||||||
let stream = TcpStream::connect(format!("{}:{}", ip, port)).expect("Tcp connection fail");
|
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!!");
|
println!("Socket Connected!!");
|
||||||
Ok(TcpSock { stream })
|
Ok(TcpSock { stream })
|
||||||
}
|
}
|
||||||
@@ -50,4 +50,4 @@ pub struct AdminConsole {
|
|||||||
|
|
||||||
impl TypeMapKey for Config {
|
impl TypeMapKey for Config {
|
||||||
type Value = Config;
|
type Value = Config;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user