This commit is contained in:
2024-05-30 02:05:42 +02:00
parent 09a8c1b021
commit 05941bafc9
3 changed files with 73 additions and 0 deletions

45
.vscode/launch.json vendored Normal file
View File

@@ -0,0 +1,45 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "lldb",
"request": "launch",
"name": "Debug executable 'rixelflood'",
"cargo": {
"args": [
"build",
"--bin=rixelflood",
"--package=rixelflood"
],
"filter": {
"name": "rixelflood",
"kind": "bin"
}
},
"args": [],
"cwd": "${workspaceFolder}",
},
{
"type": "lldb",
"request": "launch",
"name": "Debug unit tests in executable 'rixelflood'",
"cargo": {
"args": [
"test",
"--no-run",
"--bin=rixelflood",
"--package=rixelflood"
],
"filter": {
"name": "rixelflood",
"kind": "bin"
}
},
"args": [],
"cwd": "${workspaceFolder}",
}
]
}

8
Cargo.toml Normal file
View File

@@ -0,0 +1,8 @@
[package]
name = "rixelflood"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]

20
src/main.rs Normal file
View File

@@ -0,0 +1,20 @@
use std::{io::Write, net::TcpStream};
fn main() {
println!("Hello, world!");
let mut stream = TcpStream::connect("192.168.1.29:8080").unwrap();
//stream.set_nonblocking(true).unwrap();
println!("{}", std::env::var("TESTVAR").expect("Variable not defined"));
loop {
for x in 100..201 {
for y in 100..201 {
let send_string = format!("PX {:?} {:?} ff0000\n", x, y);
let buffer = send_string.as_bytes();
stream.write(&buffer).unwrap();
stream.flush().unwrap();
}
}
}
}