1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-25 20:02:37 +03:00

add 10 seconds timeout for waiting on ESP to start the update

This commit is contained in:
John Doe 2015-07-01 14:38:13 +03:00 committed by Ivan Grokhotkov
parent 5efd9a1f81
commit 03a2b4808b

View File

@ -26,16 +26,16 @@ def serve(remoteAddr, filename):
content_size = os.path.getsize(filename)
print('upload size: %d' % content_size, file=sys.stderr)
message = '%d %d %d\n' % (0, serverPort, content_size)
print('sending invitation', file=sys.stderr)
sent = sock2.sendto(message, remote_address)
sent = sock2.sendto(message, remote_address)
sent = sock2.sendto(message, remote_address)
while True:
# Wait for a connection
print('sending invitation', file=sys.stderr)
sent = sock2.sendto(message, remote_address)
sock.settimeout(10)
print('waiting...', file=sys.stderr)
connection, client_address = sock.accept()
sock.settimeout(None)
connection.settimeout(None)
try:
print('connection from', client_address, file=sys.stderr)