189 # The command string is prefixed by a 9 character long length field. |
189 # The command string is prefixed by a 9 character long length field. |
190 length = self.sock.recv(9) |
190 length = self.sock.recv(9) |
191 length = int(length) |
191 length = int(length) |
192 data = b'' |
192 data = b'' |
193 while len(data) < length: |
193 while len(data) < length: |
194 newData = self.sock.recv(length - len(data)) |
194 newByte = self.sock.recv(1) |
195 data += newData |
195 data += newByte |
|
196 if newByte == b'\n': |
|
197 break |
196 |
198 |
197 # step 2: convert the data |
199 # step 2: convert the data |
198 return data.decode('utf8', 'backslashreplace') |
200 return data.decode('utf8', 'backslashreplace') |
199 |
201 |
200 def readline_p(self, size=-1): |
202 def readline_p(self, size=-1): |