Trees | Indices | Help |
---|
|
twisted.internet.protocol.BaseProtocol --+ | twisted.internet.protocol.Protocol --+ | extern.log.log.Loggable --+ | PorterProtocol
The base porter is capable of accepting HTTP-like protocols (including RTSP) - it reads the first line of a request, and makes the decision solely on that.
We can't guarantee that we read precisely a line, so the buffer we accumulate will actually be larger than what we actually parse.
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from Inherited from Inherited from |
|
Called when a connection is made. This may be considered the initializer of the protocol, because it is called when the connection is completed. For clients, this is called once the connection to the server has been established; for servers, this is called after an accept() call stops blocking and a socket has been received. If you need to send any greeting or initial message, do it here.
|
Called when the connection is shut down. Clear any circular references here, and any external references to this Protocol. The connection has been closed.
|
Called whenever data is received. Use this method to translate to a higher-level message. Usually, some callback will be made upon the receipt of each complete protocol message.
|
Parse the initial line of the request. Return an object that can be used to uniquely identify the stream being requested by passing it to extractIdentifier, or None if the request is unreadable. Subclasses should override this. |
Recreate the initial request line from the parsed representation. The recreated line does not need to be exactly identical, but both parsedLine(unparseLine(line)) and line should contain the same information (i.e. unparseLine should not lose information). UnparseLine has to return a valid line from the porter protocol's scheme point of view (for instance, HTTP). Subclasses should override this. |
Extract a string that uniquely identifies the requested stream from the parsed representation of the first request line. Subclasses should override this, depending on how they implemented parseLine. |
Return a string that will uniquely identify the request. Subclasses should override this if they want to use request-ids and also implement injectRequestId. |
Take the parsed representation of the first request line and a string token, return a parsed representation of the request line with the request-id possibly mixed into it. Subclasses should override this if they generate request-ids. |
Write a response indicating that the requested resource was not found in this protocol. Subclasses should override this to use the correct protocol. |
Write a response indicating that the requested resource was temporarily uavailable in this protocol. Subclasses should override this to use the correct protocol. |
Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Tue Aug 13 06:17:06 2013 | http://epydoc.sourceforge.net |