diff options
author | Florian Jung <flo@windfisch.org> | 2015-04-16 18:25:34 +0200 |
---|---|---|
committer | Florian Jung <flo@windfisch.org> | 2015-04-16 18:25:34 +0200 |
commit | c065db1f08e41646fd37ea34823f7768e6904bd0 (patch) | |
tree | b4542e62d2b475bc90a660d1ea9ce9e9ac8b94cd /server2.py | |
parent | f303c0d49e3e3e5089052d797f3ab2e821c01636 (diff) |
simple rotation commands
Diffstat (limited to 'server2.py')
-rw-r--r-- | server2.py | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -62,13 +62,14 @@ while True: # Wait for a connection print >>sys.stderr, 'waiting for a connection' connection, client_address = sock.accept() + conn2 = connection.makefile() try: print >>sys.stderr, 'connection from', client_address cap = cv2.VideoCapture("flight.avi") logfile = open("flight.log", "r") while True: - data = connection.recv(16) + data = conn2.readline() if data: if data=="get\n": status, frame = cap.read() @@ -86,6 +87,8 @@ while True: elif data[0:3] == "fly" and data[-1]=="\n": values = data[3:-1].split() print "fly ",values + else: + print "corrupted command: '"+data+"'" else: print >>sys.stderr, 'no more data from', client_address break |