def test_daphn3(self):
host = self.localOptions['host']
port = int(self.localOptions['port'])
def failure(failure):
log.msg("Failed to connect")
self.report['censored'] = True
self.report['mutation'] = 0
raise Exception("Error in connection, perhaps the backend is censored")
return
def success(protocol):
log.msg("Successfully connected")
protocol.sendPayload()
return protocol.d
log.msg("Connecting to %s:%s" % (host, port))
endpoint = endpoints.TCP4ClientEndpoint(reactor, host, port)
daphn3_factory = Daphn3ClientFactory()
daphn3_factory.steps = self.input
daphn3_factory.report = self.report
d = endpoint.connect(daphn3_factory)
d.addErrback(failure)
d.addCallback(success)
return d
评论列表
文章目录