Browse Source

add basic client connectivity

Key-exchange
Niklas Eichenseer 1 year ago
parent
commit
9a1997ad55
2 changed files with 12 additions and 2 deletions
  1. 3
    0
      .gitignore
  2. 9
    2
      src/bin/client.rs

+ 3
- 0
.gitignore View File

# Added by cargo # Added by cargo


/target /target

# Needed to ignore IntelliJ stettings
/.idea

+ 9
- 2
src/bin/client.rs View File

use std::net::TcpStream;

fn main() { fn main() {
println! ("client");
}
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

Loading…
Cancel
Save