Commit 52671e3c authored by Yori Fournier's avatar Yori Fournier
Browse files

Merge branch '54-clean-server' of gitlab.aip.de:yfournier/myplotlib into modulate-servant-myplotlib

parents 9fd45a9f fe6ed4f2
......@@ -248,6 +248,8 @@ class MplClient(object):
# Send a receipt
self.sendReceipt(sock)
print('CLIENT: I received a data size of: '+str(dataSize))
# Wait for the formatted data
packedData = self.waitForData(sock, dataSize)
......@@ -294,7 +296,11 @@ class MplClient(object):
# WAIT FOR DATA ----------------------------------------------------
def waitForData(self, sock, dataSize):
'''Wait for data of size dataSize.'''
unpackedData = sock.recv(dataSize)
receivedSize = 0
unpackedData = b''
while receivedSize < dataSize:
unpackedData += sock.recv(4096)
receivedSize = len(unpackedData)
return(unpackedData)
# UNPACKING --------------------------------------------------------
......
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