feat: added framework for TCP client
This commit is contained in:
@@ -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"] }
|
||||
@@ -0,0 +1,4 @@
|
||||
#[tokio::main]
|
||||
async fn main() {
|
||||
println!("Hello, world!");
|
||||
}
|
||||
Binary file not shown.
@@ -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")
|
||||
Reference in New Issue
Block a user