|
|
@@ -4,7 +4,7 @@ use std::net::TcpStream; |
|
|
|
fn main() { |
|
|
|
//let stream = TcpStream::connect("172.30.16.1:8080"); |
|
|
|
//let stream = TcpStream::connect("27.0.0.1:8080"); |
|
|
|
match TcpStream::connect("localhost:3333") { |
|
|
|
match TcpStream::connect("localhost:7878") { |
|
|
|
Ok(mut stream) => { |
|
|
|
println!("Successfully connected to server"); |
|
|
|
|
|
|
@@ -12,12 +12,12 @@ fn main() { |
|
|
|
let mut buffer = String::new(); |
|
|
|
match std::io::stdin().read_line(&mut buffer) { |
|
|
|
Ok(n) => { |
|
|
|
if n == 0 { |
|
|
|
break; |
|
|
|
} |
|
|
|
if n == 0 { |
|
|
|
break; // Beenden bei EOF |
|
|
|
} |
|
|
|
println!("Sending {}", buffer); |
|
|
|
stream.write(buffer.as_bytes()).unwrap(); |
|
|
|
println!("Sent {}, awaiting reply...", buffer); |
|
|
|
println!("Sent {}, awaiting reply ...", buffer); |
|
|
|
} |
|
|
|
Err(error) => { |
|
|
|
println!("error: {error}"); |
|
|
@@ -25,7 +25,7 @@ fn main() { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
} |
|
|
|
Err(e) => { |
|
|
|
println!("Failed to connect: {}", e); |
|
|
|
} |