How to receive a lot of data in python socket

    def receive_data(self):
        data = b''
        while True:
            partial_data = self.socket_connection.recv(self.buff_size)
            data = data + partial_data
            if len(partial_data) < self.buff_size:
                # either 0 or end of data
                break
        return data