def data_received(self, data):
        print("%s: data received" % self.name)
        self.data.append(data)
        if self.expectation and not self.expectation.done():
            self.expected_received += len(data)

            if self.expected_received >= self.expected:
                self.expectation.set_result(None)