aboutsummaryrefslogtreecommitdiff
path: root/UDPInput.py
diff options
context:
space:
mode:
Diffstat (limited to 'UDPInput.py')
-rw-r--r--UDPInput.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/UDPInput.py b/UDPInput.py
new file mode 100644
index 0000000..f0af2b0
--- /dev/null
+++ b/UDPInput.py
@@ -0,0 +1,16 @@
+import Util, Input
+import socket
+class UDPInput(Input.Input):
+ def inputInit(self):
+ HOST = '' # Symbolic name meaning all available interfaces
+ PORT = self.argDict['Port'] # Arbitrary non-privileged port
+ self.sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
+ self.sock.bind((HOST, PORT))
+ print 'UDPINIT'
+ def sensingLoop(self):
+ print 'udploop'
+ (data,address) = self.sock.recvfrom(1024)
+ dataDict = {'data':data, 'address':address}
+ print 'LOLOLOLOL'
+ self.respond(dataDict)
+