Files @ 238fbd5266ea
Branch filter:

Location: light9/light8/potserver.py

drewp
new server that sends levels like "55 25 47 35\n" on the port 'serpots'
#!/usr/bin/python

import socket

from io import *

pots = SerialPots()
pots.golive()

while 1:
    l=pots.getlevels()
    try:
        s=socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        s.connect(("dash", socket.getservbyname('serpots','tcp')))

        s.send("%d %d %d %d\n" % l)
        s.close()
    except Exception,e:
        print "Exception: %s" % e