Here are the examples of the python api twisted.internet.protocol.ClientFactory.buildProtocol taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
27 Examples
3
Example 1
def buildProtocol(self, addr):
r=ClientFactory.buildProtocol(self, addr)
r.postHandshakeEndpoint = self.postHandshakeEndpoint
r.postHandshakeFactory = self.postHandshakeFactory
r.handshakeDone = self.handshakeDone
return r
3
Example 2
def buildProtocol(self, address):
# Create the fuzzer instance
protocol_instance = ClientFactory.buildProtocol(self, address)
# Tell the fuzzer instance which type of session it should run
protocol_instance.current_session = iter(self.session.next())
protocol_instance.fuzzdata = self.fuzzdata
protocol_instance.session_id = str(uuid.uuid4())
protocol_instance.fuzz_ratio = self.fuzz_ratio
protocol_instance.send_delay = self.send_delay
protocol_instance.validcases_path = self.validcases_path
return protocol_instance
3
Example 3
def buildProtocol(self, address):
# Create the fuzzer instance
protocol_instance = ClientFactory.buildProtocol(self, address)
# Tell the fuzzer instance which type of session it should run
protocol_instance.session_id = str(uuid.uuid4())
return protocol_instance
3
Example 4
def buildProtocol(self, addr):
proto = ClientFactory.buildProtocol(self, addr)
proto.nickname = self.task.nickname
proto.password = self.task.password
proto.source_url = self.task.source_url
return proto
3
Example 5
def buildProtocol(self, *args, **kw):
"""
This method overrides the base class method, because we want to connect
the objects together. Note that the setReseiver method that is called
is from this factory's protocol, not from the factory itself.
"""
protObj = protocol.ClientFactory.buildProtocol(self, *args, **kw)
protObj.setReceiver(self.receiver)
return protObj
3
Example 6
def buildProtocol(self, *args, **kwargs):
twunnel.logger.log(3, "trace: OutputProtocolFactory.buildProtocol")
outputProtocol = protocol.ClientFactory.buildProtocol(self, *args, **kwargs)
outputProtocol.inputProtocol = self.inputProtocol
outputProtocol.inputProtocol.outputProtocol = outputProtocol
return outputProtocol
3
Example 7
def buildProtocol(self, *args, **kwargs):
twunnel.logger.log(3, "trace: HTTPSInputProtocolFactory.buildProtocol")
inputProtocol = protocol.ClientFactory.buildProtocol(self, *args, **kwargs)
inputProtocol.configuration = self.configuration
inputProtocol.outputProtocolConnectionManager = self.outputProtocolConnectionManager
return inputProtocol
3
Example 8
def buildProtocol(self, *args, **kwargs):
twunnel.logger.log(3, "trace: SOCKS4InputProtocolFactory.buildProtocol")
inputProtocol = protocol.ClientFactory.buildProtocol(self, *args, **kwargs)
inputProtocol.configuration = self.configuration
inputProtocol.outputProtocolConnectionManager = self.outputProtocolConnectionManager
return inputProtocol
3
Example 9
def buildProtocol(self, *args, **kwargs):
twunnel.logger.log(3, "trace: SOCKS5InputProtocolFactory.buildProtocol")
inputProtocol = protocol.ClientFactory.buildProtocol(self, *args, **kwargs)
inputProtocol.configuration = self.configuration
inputProtocol.outputProtocolConnectionManager = self.outputProtocolConnectionManager
return inputProtocol
3
Example 10
def buildProtocol(self, address):
twunnel.logger.log(3, "trace: SSHClientTransportFactory.buildProtocol")
p = protocol.ClientFactory.buildProtocol(self, address)
p.configuration = self.configuration
return p
3
Example 11
def buildProtocol(self, addr):
r=ClientFactory.buildProtocol(self, addr)
r.postHandshakeEndpoint = self.postHandshakeEndpoint
r.postHandshakeFactory = self.postHandshakeFactory
r.handshakeDone = self.handshakeDone
r._timestamps = self._timestamps
r._timer = self._timer
return r
3
Example 12
def buildProtocol(self, addr):
# Setup timeout callback
proto = protocol.ClientFactory.buildProtocol(self, addr)
call_id = reactor.callLater(self.conf['timeout'], proto.timeout)
self.deferred.addBoth(self._cancelTimeout, call_id)
return proto
3
Example 13
def buildProtocol(self, address):
proto = protocol.ClientFactory.buildProtocol(self, address)
channel = Channel(proto, "tcp")
channel.party = "client"
proto.channel = channel
self.callback_(channel)
return proto
3
Example 14
def buildProtocol(self, addr):
p = protocol.ClientFactory.buildProtocol(self, addr)
username = self.settings["Username"]
p.registerAuthenticator(imap4.CramMD5ClientAuthenticator(username))
p.registerAuthenticator(imap4.LOGINAuthenticator(username))
p.registerAuthenticator(imap4.PLAINAuthenticator(username))
return p
3
Example 15
def buildProtocol(self, addr):
p = protocol.ClientFactory.buildProtocol(self, addr)
if self.timeout:
timeoutCall = reactor.callLater(self.timeout, p.timeout)
self.deferred.addBoth(self._cancelTimeout, timeoutCall)
return p
0
Example 16
def buildProtocol(self, addr):
self.proto = ClientFactory.buildProtocol(self, addr)
return self.proto
0
Example 17
def buildProtocol(self, addr):
p = protocol.ClientFactory.buildProtocol(self, addr)
self.onConnect.callback(p)
return p
0
Example 18
def buildProtocol(self, addr):
result = protocol.ClientFactory.buildProtocol(self, addr)
self.proto = result
return result
0
Example 19
def buildProtocol(self, addr):
p = protocol.ClientFactory.buildProtocol(self, addr)
p.out = self.out
p.out.out = p
return p
0
Example 20
def buildProtocol(self, addr):
p = protocol.ClientFactory.buildProtocol(self, addr)
p.persistentTimeOut = p.timeOut = self.memcachedTimeout
return p
0
Example 21
def buildProtocol(self, addr):
protocol = ClientFactory.buildProtocol(self, addr)
protocol.nickname = self._client.world.player.name
return protocol
0
Example 22
def buildProtocol(self, *args, **kw):
the_protocol = protocol.ClientFactory.buildProtocol(self, *args, **kw)
the_protocol.set_peer(self.server)
return the_protocol
0
Example 23
def buildProtocol(self, addr):
p = protocol.ClientFactory.buildProtocol(self, addr)
return p
0
Example 24
def buildProtocol(self, addr):
if self.returnNoProtocol:
return None
self.proto = protocol.ClientFactory.buildProtocol(self, addr)
return self.proto
0
Example 25
def buildProtocol(self, address):
proto = ClientFactory.buildProtocol(self, address)
proto.task_num = self.task_num
self.task_num += 1
return proto
0
Example 26
def buildProtocol(self, *args, **kw):
prot = protocol.ClientFactory.buildProtocol(self, *args, **kw)
prot.setPeer(self.server)
return prot
0
Example 27
def buildProtocol(self, *args, **kw):
prot = protocol.ClientFactory.buildProtocol(self, *args, **kw)
prot.setPeer(self.deviceProtocol)
prot.addHandlers(self.dispatchHandlers)
return prot