def rcv():
data = b''
while 1:
try:
r = client_socket.recv(90456)
if len(r) == 0:
exit(0)
a = r.find(b'END!')
if a != -1:
data += r[:a]
break
data += r
except Exception as e:
print(e)
continue
nparr = numpy.fromstring(data, numpy.uint8)
frame = cv2.imdecode(nparr, cv2.IMREAD_COLOR)
if type(frame) is type(None):
pass
else:
try:
cv2.imshow(name,frame)
if cv2.waitKey(10) == ord('q'):
client_socket.close()
sys.exit()
except:
client_socket.close()
exit(0)
评论列表
文章目录