feat: added framework for TCP client

This commit is contained in:
Andrew Rioux
2023-09-14 01:30:29 -04:00
parent fb98d062ef
commit 0ef459bcfe
8 changed files with 148 additions and 14 deletions

View File

@@ -0,0 +1,12 @@
[package]
name = "tcp-test"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
pcap-sys = { path = "../../pcap-sys" }
nl-sys = { path = "../../nl-sys" }
rand = "0.8.5"
tokio = { version = "1.32.0", features = ["full"] }

View File

@@ -0,0 +1,4 @@
#[tokio::main]
async fn main() {
println!("Hello, world!");
}

Binary file not shown.

13
tcp-test/server.py Normal file
View File

@@ -0,0 +1,13 @@
#!/usr/bin/env python3
import socket
server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server.bind(("0.0.0.0", 54248))
server.listen(32)
client, addr = server.accept()
with client:
print(client.recv(24))
client.sendall(b"pong")