Commit c7ad294b authored by Guillaume Seguin's avatar Guillaume Seguin

Abort connection attempt after 4 failed writes

parent da03db5b
...@@ -239,6 +239,9 @@ class printcore(): ...@@ -239,6 +239,9 @@ class printcore():
def _listen_until_online(self): def _listen_until_online(self):
while not self.online and self._listen_can_continue(): while not self.online and self._listen_can_continue():
self._send("M105") self._send("M105")
if self.writefailures >= 4:
print _("Aborting connection attempt after 4 failed writes.")
return
empty_lines = 0 empty_lines = 0
while self._listen_can_continue(): while self._listen_can_continue():
line = self._readline() line = self._readline()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment