10 lines
263 B
Rust
10 lines
263 B
Rust
use std::net::TcpStream;
|
|
|
|
fn main() {
|
|
let stream = TcpStream::connect("127.0.0.1:8080");
|
|
if stream.is_ok() {
|
|
println!("Connected to the server!");
|
|
} else {
|
|
println!("Couldn't connect to server...");
|
|
}
|
|
} // the stream is closed here
|