Test 3
This commit is contained in:
parent
a381805c3c
commit
05cc3cb8e6
@ -82,7 +82,6 @@ class Server:
|
|||||||
continue
|
continue
|
||||||
input_data = await reader.read(self.buffer_chunk_size)
|
input_data = await reader.read(self.buffer_chunk_size)
|
||||||
if connection_token not in self.buffers:
|
if connection_token not in self.buffers:
|
||||||
print("Here!")
|
|
||||||
break
|
break
|
||||||
self.buffers[connection_token].append(input_data)
|
self.buffers[connection_token].append(input_data)
|
||||||
except ConnectionResetError as e:
|
except ConnectionResetError as e:
|
||||||
@ -101,12 +100,14 @@ class Server:
|
|||||||
# Slow down if buffer is empty; after 1.5 s of silence, break
|
# Slow down if buffer is empty; after 1.5 s of silence, break
|
||||||
consecutive_interruptions += 1
|
consecutive_interruptions += 1
|
||||||
if consecutive_interruptions > 3:
|
if consecutive_interruptions > 3:
|
||||||
|
print("Too many interruptions")
|
||||||
break
|
break
|
||||||
await asyncio.sleep(.5)
|
await asyncio.sleep(.5)
|
||||||
continue
|
continue
|
||||||
else:
|
else:
|
||||||
consecutive_interruptions = 0
|
consecutive_interruptions = 0
|
||||||
if not input_data:
|
if not input_data:
|
||||||
|
print("No input data received")
|
||||||
break
|
break
|
||||||
try:
|
try:
|
||||||
writer.write(input_data)
|
writer.write(input_data)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user