t.p.a.ProtocolSwitchCommand(Command) : class documentation

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.
Class Method makeResponse Serialize a mapping of arguments using this Command's response schema.
Method _doCommand 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.

Inherited from Command:

Class __metaclass__ Metaclass hack to establish reverse-mappings for 'errors' and 'fatalErrors' as class vars.
Class Method makeArguments Serialize a mapping of arguments using this Command's argument schema.
Class Method parseResponse Parse a mapping of serialized arguments using this Command's response schema.
Class Method parseArguments Parse a mapping of serialized arguments using this Command's argument schema.
Class 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.
@classmethod
def makeResponse(cls, innerProto, proto): (source)
Serialize a mapping of arguments using this Command's response schema.
Parametersobjectsa dict with keys matching the names specified in self.response, having values of the types that the Argument objects in self.response 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 at 2011-10-27 16:17:34.