From cfae93475dfb4cb5cfe264f4c029136e1447c262 Mon Sep 17 00:00:00 2001
From: Sanjit Bhat <sanjit.bhat@gmail.com>
Date: Thu, 26 Oct 2023 06:44:48 -0400
Subject: net add missing files

---
 server.py | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 server.py

(limited to 'server.py')

diff --git a/server.py b/server.py
new file mode 100644
index 0000000..2421c31
--- /dev/null
+++ b/server.py
@@ -0,0 +1,13 @@
+import socket
+import sys
+
+sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
+addr = ('localhost', int(sys.argv[1]))
+print('listening on %s port %s' % addr, file=sys.stderr)
+sock.bind(addr)
+
+while True:
+    buf, raddr = sock.recvfrom(4096)
+    print(buf.decode("utf-8"), file=sys.stderr)
+    if buf:
+        sent = sock.sendto(b'this is the host!', raddr)
-- 
cgit v1.2.3