Class t.p.a.ProtocolSwitchCommand(Command):

Part of twisted.protocols.amp View Source View In Hierarchy

Use this command to switch from something Amp-derived to a different protocol mid-connection. This can be useful to use amp as the connection-startup negotiation phase. Since TLS is a different layer entirely, you can use Amp to negotiate the security parameters of your connection, then switch to a different protocol, and the connection will remain secured.
Method __init__ Create a ProtocolSwitchCommand.
Method makeResponse This is a hook which can be used to implement a custom factory
Method _doCommand When we emit a ProtocolSwitchCommand, lock the protocol, but don't actually

Inherited from Command:

Class __metaclass__ Metaclass hack to establish reverse-mappings for 'errors' and
Method responder Declare a method to be a responder for a particular command.
def __init__(self, _protoToSwitchToFactory, **kw): (source)
Create a ProtocolSwitchCommand.
Parameters_protoToSwitchToFactorya ProtocolFactory which will generate the Protocol to switch to.
kwKeyword arguments, encoded and handled normally as Command would.
def makeResponse(cls, innerProto, proto): (source)
This is a hook which can be used to implement a custom factory response.
Parametersobjectsa dict with keys similar to the names specified in self.arguments, having values of the types that the Argument objects in self.arguments can format.
protoan AMP.
Returnsan AmpBox.
def _doCommand(self, proto): (source)
When we emit a ProtocolSwitchCommand, lock the protocol, but don't actually switch to the new protocol unless an acknowledgement is received. If an error is received, switch back.
API Documentation for twisted, generated by pydoctor.