minor changes
This commit is contained in:
parent
b9a13e29dd
commit
005d5d3b19
@ -19,14 +19,12 @@ fn write_to_server(stream: TcpStream) {
|
|||||||
match &*get_entry() {
|
match &*get_entry() {
|
||||||
"/quit" => {
|
"/quit" => {
|
||||||
println!("Disconnecting...");
|
println!("Disconnecting...");
|
||||||
// send!("BYE");
|
|
||||||
writeln!(writer, "BYE").unwrap();
|
writeln!(writer, "BYE").unwrap();
|
||||||
writer.flush().unwrap();
|
writer.flush().unwrap();
|
||||||
println!("Disconnected!");
|
println!("Disconnected!");
|
||||||
return ();
|
return ();
|
||||||
}
|
}
|
||||||
line => {
|
line => {
|
||||||
// send!(line);
|
|
||||||
writeln!(writer, "{}", line).unwrap();
|
writeln!(writer, "{}", line).unwrap();
|
||||||
writer.flush().unwrap();
|
writer.flush().unwrap();
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,11 @@ fn main() {
|
|||||||
// Client opened //
|
// Client opened //
|
||||||
///////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////
|
||||||
println!("Client connecting on server {}:{}", args[1], args[2]);
|
println!("Client connecting on server {}:{}", args[1], args[2]);
|
||||||
let mut serv = args[1].clone();
|
let mut serv: String = if args[1] == "localhost" {
|
||||||
|
String::from("127.0.0.1")
|
||||||
|
} else {
|
||||||
|
args[1].clone()
|
||||||
|
};
|
||||||
serv.push(':');
|
serv.push(':');
|
||||||
serv.push_str(&args[2]);
|
serv.push_str(&args[2]);
|
||||||
client::client(serv);
|
client::client(serv);
|
||||||
|
Loading…
Reference in New Issue
Block a user