@@ -0,0 +1,1466 @@
+#!/usr/bin/env python%0A%22%22%22%0AAttempt to comunicate with Nitroshare.%0A%0A %5Bx%5D listen nitroshare broadcasts and show who is available%0A   %5Bx%5D listen for UDP packets on port 40816%0A%0A%22%22%22%0A%0A# --- communicating.. networking.. ---%0A%0Aimport socket%0A%0AIP4 = socket.AF_INET%0AUDP = socket.SOCK_DGRAM%0A%0Aclass UDPSocketStream(object):%0A  %22%22%22 Convert network socket endpoint to a readable stream object %22%22%22%0A  def __init__(self, host='0.0.0.0', port=40816):%0A    # reading from socket blocks keyboard input, so CtrlC/CtrlBreak%0A    # may not work until read operation completes%0A    sock = socket.socket(IP4, UDP)%0A    # on socket level, allow multiple programs listen in the same address%0A    #sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)%0A    sock.bind((host, port))%0A    self.sock = sock%0A%0A  def read(self, size):%0A      return self.sock.recvfrom(size)%5B0%5D%0A%0A  def close(self):%0A    try:%0A      self.sock.shutdown(socket.SHUT_RDWR)%0A    except:%0A      pass%0A    self.sock.close()%0A%0A# --- /networking ---%0A%0Adef nitrolisten():%0A  import json%0A  s = UDPSocketStream()%0A%0A  while True:%0A    data, remote = s.sock.recvfrom(1024)%0A    #print(%22Got packet!%22)%0A    #print data%0A    # msg = %7Bu'uuid': u'%7Beb8d3a1e-c50f-459d-9be7-6a70b91ca6bd%7D', u'operating_system': u'linux', u'name': u'XONiTE', u'port': u'40818'%7D%0A    msg = json.loads(data)%0A    print(%22Got response from %25s (%25s) on %25s:%25s %22 %25 (msg%5Bu'name'%5D, msg%5Bu'operating_system'%5D.capitalize(), remote%5B0%5D, msg%5Bu'port'%5D))%0A%0Aif __name__ == '__main__':%0A  nitrolisten()%0A

Add first draft of Nitroshare UDP discovery