commit
de5b2801f9
8 changed files with 70 additions and 0 deletions
@ -0,0 +1,2 @@ |
|||||
|
/target |
||||
|
**/*.rs.bk |
||||
@ -0,0 +1,16 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<project version="4"> |
||||
|
<component name="CargoProjects"> |
||||
|
<cargoProject FILE="$PROJECT_DIR$/Cargo.toml" /> |
||||
|
</component> |
||||
|
<component name="JavaScriptSettings"> |
||||
|
<option name="languageLevel" value="ES6" /> |
||||
|
</component> |
||||
|
<component name="MacroExpansionManager"> |
||||
|
<option name="directoryName" value="lbsqolEk" /> |
||||
|
</component> |
||||
|
<component name="RustProjectSettings"> |
||||
|
<option name="toolchainHomeDirectory" value="/usr/bin" /> |
||||
|
<option name="version" value="2" /> |
||||
|
</component> |
||||
|
</project> |
||||
@ -0,0 +1,8 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<project version="4"> |
||||
|
<component name="ProjectModuleManager"> |
||||
|
<modules> |
||||
|
<module fileurl="file://$PROJECT_DIR$/../noobctf-client/.idea/untitled.iml" filepath="$PROJECT_DIR$/../noobctf-client/.idea/untitled.iml" /> |
||||
|
</modules> |
||||
|
</component> |
||||
|
</project> |
||||
@ -0,0 +1,14 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<module type="CPP_MODULE" version="4"> |
||||
|
<component name="NewModuleRootManager"> |
||||
|
<content url="file://$MODULE_DIR$/../noobctf-client"> |
||||
|
<sourceFolder url="file://$MODULE_DIR$/../noobctf-client/src" isTestSource="false" /> |
||||
|
<sourceFolder url="file://$MODULE_DIR$/../noobctf-client/examples" isTestSource="false" /> |
||||
|
<sourceFolder url="file://$MODULE_DIR$/../noobctf-client/tests" isTestSource="true" /> |
||||
|
<sourceFolder url="file://$MODULE_DIR$/../noobctf-client/benches" isTestSource="true" /> |
||||
|
<excludeFolder url="file://$MODULE_DIR$/../noobctf-client/target" /> |
||||
|
</content> |
||||
|
<orderEntry type="inheritedJdk" /> |
||||
|
<orderEntry type="sourceFolder" forTests="false" /> |
||||
|
</component> |
||||
|
</module> |
||||
@ -0,0 +1,6 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<project version="4"> |
||||
|
<component name="VcsDirectoryMappings"> |
||||
|
<mapping directory="$PROJECT_DIR$/../noobctf-client" vcs="Git" /> |
||||
|
</component> |
||||
|
</project> |
||||
@ -0,0 +1,4 @@ |
|||||
|
[[package]] |
||||
|
name = "untitled" |
||||
|
version = "0.1.0" |
||||
|
|
||||
@ -0,0 +1,7 @@ |
|||||
|
[package] |
||||
|
name = "untitled" |
||||
|
version = "0.1.0" |
||||
|
authors = ["Michael Preisach <michael@preisach.at>"] |
||||
|
edition = "2018" |
||||
|
|
||||
|
[dependencies] |
||||
@ -0,0 +1,13 @@ |
|||||
|
use std::net::{TcpStream, TcpListener}; |
||||
|
use std::io::prelude::*; |
||||
|
use std::io; |
||||
|
|
||||
|
fn main() { |
||||
|
let address = "127.0.0.1:8000"; |
||||
|
let mut text = String::new(); |
||||
|
let mut stream = TcpStream::connect(address).expect("connection failed"); |
||||
|
|
||||
|
write!(stream,"hello from the client!\n").expect("write failed"); |
||||
|
stream.read_to_string(&mut text).expect("read failed"); |
||||
|
println!("received: '{}'", text.trim_right()); |
||||
|
} |
||||
Loading…
Reference in new issue