Fixed bug non-closing socket client when connection is closed
authorLaurent Bessard
Wed, 20 Feb 2013 19:17:49 +0100
changeset 25 c5b5509bd224
parent 24 04205032298b
child 26 735464c8616a
Fixed bug non-closing socket client when connection is closed
LPCManager.py
--- a/LPCManager.py	Wed Feb 20 19:00:10 2013 +0100
+++ b/LPCManager.py	Wed Feb 20 19:17:49 2013 +0100
@@ -1809,7 +1809,10 @@
     def readline(self):
         idx = self.Buffer.find("\n")
         while idx == -1:
-            self.Buffer += self.socket.recv(2048)
+            text = self.socket.recv(2048)
+            if text == "":
+                break
+            self.Buffer += text
             idx = self.Buffer.find("\n")
         if idx != -1:
             line = self.Buffer[:idx+1]