From 81faf3bd45053172cd352f906cfba659952cdcfc Mon Sep 17 00:00:00 2001 From: Seth Samuel Date: Thu, 7 Nov 2024 21:39:54 +1300 Subject: [PATCH] able to recieve packets --- OutGaugeInterpreter.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/OutGaugeInterpreter.py b/OutGaugeInterpreter.py index df94cd9..c5cad81 100644 --- a/OutGaugeInterpreter.py +++ b/OutGaugeInterpreter.py @@ -1 +1,11 @@ -print("hello World") \ No newline at end of file +import socket + +UDP_IP = "127.0.0.1" +UDP_PORT = 4444 + +sock = socket.socket(socket.AF_INET,socket.SOCK_DGRAM) +sock.bind((UDP_IP,UDP_PORT)) + +while True: + data, addr = sock.recvfrom(1024) + print("received mesage: %s" % data) \ No newline at end of file