summaryrefslogtreecommitdiffstats
path: root/god/Reaktor
diff options
context:
space:
mode:
Diffstat (limited to 'god/Reaktor')
-rwxr-xr-xgod/Reaktor22
1 files changed, 22 insertions, 0 deletions
diff --git a/god/Reaktor b/god/Reaktor
new file mode 100755
index 00000000..54bc5099
--- /dev/null
+++ b/god/Reaktor
@@ -0,0 +1,22 @@
+#! /usr/bin/env python
+
+import socket
+from struct import unpack
+
+listen_address = '0.0.0.0'
+listen_port = 2342
+
+# create udp socket
+mysocket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
+
+# allow send/recieve from broacast address
+mysocket.setsockopt(socket.SOL_SOCKET,socket.SO_BROADCAST,1)
+
+# allow the socket to be re-used
+mysocket.setsockopt(socket.SOL_SOCKET,socket.SO_REUSEADDR,1)
+mysocket.bind((listen_address, listen_port))
+
+while True:
+ dev, state = unpack('BB', mysocket.recv(2))
+ print "dev: " + str(dev)
+ print "state: " + str(state)