def METHOD_NAME(self, maxlen):
    chunks = []
    bytes_recd = 0
    while bytes_recd < maxlen:
        chunk = self.conn.recv(min(maxlen - bytes_recd, 2048))
        bytes_recd = bytes_recd + len(chunk)
        print(bytes_recd)
        if chunk == '':
            print("Number of chunks received so far:", len(chunks), bytes_recd)
            break
            #raise RuntimeError("socket connection broken")
        chunks.append(chunk)
    return ''.join(chunks)