summaryrefslogtreecommitdiff
path: root/server2.py
diff options
context:
space:
mode:
authorFlorian Jung <flo@windfisch.org>2015-04-16 18:25:34 +0200
committerFlorian Jung <flo@windfisch.org>2015-04-16 18:25:34 +0200
commitc065db1f08e41646fd37ea34823f7768e6904bd0 (patch)
treeb4542e62d2b475bc90a660d1ea9ce9e9ac8b94cd /server2.py
parentf303c0d49e3e3e5089052d797f3ab2e821c01636 (diff)
simple rotation commands
Diffstat (limited to 'server2.py')
-rw-r--r--server2.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/server2.py b/server2.py
index 587b5e5..19564cc 100644
--- a/server2.py
+++ b/server2.py
@@ -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