'Create a L{AccumulatingProtocol} and set it up to be able to perform
callbacks.'

def buildProtocol(self, addr):

    self.peerAddresses.append(addr)
    self.called += 1
    p = self.protocolFactory()
    p.factory = self
    p.closedDeferred = self.protocolConnectionLost
    self.protocolConnectionLost = None
    self.protocol = p
    return p
