minor changes
This commit is contained in:
parent
b9a13e29dd
commit
005d5d3b19
@ -19,14 +19,12 @@ fn write_to_server(stream: TcpStream) {
|
||||
match &*get_entry() {
|
||||
"/quit" => {
|
||||
println!("Disconnecting...");
|
||||
// send!("BYE");
|
||||
writeln!(writer, "BYE").unwrap();
|
||||
writer.flush().unwrap();
|
||||
println!("Disconnected!");
|
||||
return ();
|
||||
}
|
||||
line => {
|
||||
// send!(line);
|
||||
writeln!(writer, "{}", line).unwrap();
|
||||
writer.flush().unwrap();
|
||||
}
|
||||
|
@ -21,7 +21,11 @@ fn main() {
|
||||
// Client opened //
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
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_str(&args[2]);
|
||||
client::client(serv);
|
||||
|
Loading…
Reference in New Issue
Block a user