Debug Client: made the receiving of commands a bit more resilient.

Wed, 30 Dec 2020 12:31:25 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Wed, 30 Dec 2020 12:31:25 +0100
changeset 7926
5357e5ffebf1
parent 7925
45f94a7c5c2e
child 7927
866ddf957461

Debug Client: made the receiving of commands a bit more resilient.

eric6/DebugClients/Python/AsyncFile.py file | annotate | diff | comparison | revisions
eric6/DebugClients/Python/DebugClientBase.py file | annotate | diff | comparison | revisions
--- a/eric6/DebugClients/Python/AsyncFile.py	Wed Dec 30 12:30:42 2020 +0100
+++ b/eric6/DebugClients/Python/AsyncFile.py	Wed Dec 30 12:31:25 2020 +0100
@@ -191,8 +191,10 @@
         length = int(length)
         data = b''
         while len(data) < length:
-            newData = self.sock.recv(length - len(data))
-            data += newData
+            newByte = self.sock.recv(1)
+            data += newByte
+            if newByte == b'\n':
+                break
         
         # step 2: convert the data
         return data.decode('utf8', 'backslashreplace')
--- a/eric6/DebugClients/Python/DebugClientBase.py	Wed Dec 30 12:30:42 2020 +0100
+++ b/eric6/DebugClients/Python/DebugClientBase.py	Wed Dec 30 12:31:25 2020 +0100
@@ -1130,7 +1130,7 @@
         """
         Public method called when there is data ready to be read.
         
-        @param stream file like object that has data to be written
+        @param stream file like object that has data to be read
         @return flag indicating an error condition
         @rtype bool
         """

eric ide

mercurial