Initial commit

This commit is contained in:
2026-02-17 23:54:13 +01:00
commit c02ec01f75
14 changed files with 935 additions and 0 deletions

14
basic-udp/udp-dump.py Normal file
View File

@@ -0,0 +1,14 @@
import socket, time
UDP_IP = "192.168.2.99"
UDP_PORT = 5505
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
#sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT, 1)
sock.bind((UDP_IP, UDP_PORT))
print(f"Listening on UDP port {UDP_PORT}...")
while True:
data, addr = sock.recvfrom(1024)
print(f"{time.ctime()} [{addr[0]}:{addr[1]}] {data.decode('utf-8', errors='replace')}")