From c065db1f08e41646fd37ea34823f7768e6904bd0 Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Thu, 16 Apr 2015 18:25:34 +0200 Subject: simple rotation commands --- server2.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'server2.py') 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 -- cgit v1.2.1