summaryrefslogtreecommitdiff
path: root/server2.py
diff options
context:
space:
mode:
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