src/eric7/Debugger/DebuggerInterfacePython.py

branch
eric7-maintenance
changeset 10733
d96c69a235fc
parent 10694
f46c1e224e8a
parent 10697
8a609e4c71b6
child 10814
ba20efe10336
equal deleted inserted replaced
10695:161fdb080c76 10733:d96c69a235fc
1402 Private method to handle data from the client. 1402 Private method to handle data from the client.
1403 1403
1404 @param sock reference to the socket to read data from 1404 @param sock reference to the socket to read data from
1405 @type QTcpSocket 1405 @type QTcpSocket
1406 """ 1406 """
1407 headerSize = struct.calcsize(b"!II")
1408
1407 while sock and sock.bytesAvailable(): 1409 while sock and sock.bytesAvailable():
1408 header = sock.read(struct.calcsize(b"!II")) 1410 now = time.monotonic()
1411 while sock.bytesAvailable() < headerSize:
1412 sock.waitForReadyRead(50)
1413 if time.monotonic() - now > 2.0: # 2 seconds timeout
1414 return
1415 header = sock.read(headerSize)
1409 length, datahash = struct.unpack(b"!II", header) 1416 length, datahash = struct.unpack(b"!II", header)
1410 1417
1411 data = bytearray() 1418 data = bytearray()
1412 now = time.monotonic() 1419 now = time.monotonic()
1413 while len(data) < length: 1420 while len(data) < length:

eric ide

mercurial