8000 Use async sleep, increase chunk size · smartcoder00/arduinoWebSockets@94a531c · GitHub
[go: up one dir, main page]

Skip to content

Commit 94a531c

Browse files
Tony763Links2004
authored andcommitted
Use async sleep, increase chunk size
1 parent ccdba4e commit 94a531c

File tree

1 file changed

+2
-2
lines changed
  • examples/esp8266/WebSocketClientOTA/python_ota_server

1 file changed

+2
-2
lines changed

examples/esp8266/WebSocketClientOTA/python_ota_server/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,15 @@ async def binary_send(websocket, fw_file):
5555
with open(fw_file, "rb") as binaryfile:
5656

5757
while True:
58-
chunk = binaryfile.read(2048)
58+
chunk = binaryfile.read(4096)
5959
if not chunk:
6060
break
6161
try:
6262
await websocket.send(chunk)
6363
except Exception as exception:
6464
Logger.exception(exception)
6565
return False
66-
time.sleep(0.2)
66+
asyncio.sleep(0.2)
6767

6868

6969
def version_checker(name, vdev, vapp):

0 commit comments

Comments
 (0)
0