class documentation
class NetstringTracker(basic.NetstringReceiver): (source)
A netstring receiver which keeps track of the strings received.
Method | __init__ |
Undocumented |
Method | string |
Receive a string and append it to self.strings. |
Instance Variable | strings |
A list of received strings, in order. |
Inherited from NetstringReceiver
:
Method | data |
Receives some characters of a netstring. |
Method | make |
Initializes the protocol. |
Method | send |
Sends a netstring. |
Constant | MAX |
Defines the maximum length of netstrings that can be received. |
Instance Variable | broken |
Indicates if the connection is still functional |
Method | _check |
Checks if the netstring has a trailing comma at the expected position. |
Method | _check |
Makes sure that the received data represents a valid number. |
Method | _check |
Checks the sanity of lengthAsString. |
Method | _consume |
Consumes the content of self._remainingData. |
Method | _consume |
Consumes the length portion of self._remainingData. |
Method | _consume |
Consumes the payload portion of self._remainingData. |
Method | _extract |
Attempts to extract the length information of a netstring. |
Method | _extract |
Extracts payload information from self._remainingData. |
Method | _handle |
Terminates the connection and sets the flag self.brokenPeer. |
Method | _max |
Calculate and return the string size of self.MAX_LENGTH. |
Method | _payload |
Checks if enough data have been received to complete the netstring. |
Method | _prepare |
Sets up variables necessary for consuming the payload of a netstring. |
Method | _process |
Processes the length definition of a netstring. |
Method | _process |
Processes the actual payload with stringReceived . |
Constant | _LENGTH |
A pattern describing all strings that contain a netstring length specification. Examples for length specifications are b'0:', b'12:', and b'179:'. b'007:' is not a valid length specification, since leading zeros are not allowed. |
Constant | _LENGTH |
A pattern describing all strings that contain the first part of a netstring length specification (without the trailing comma). Examples are '0', '12', and '179'. '007' does not start a netstring length specification, since leading zeros are not allowed. |
Constant | _MISSING |
Undocumented |
Constant | _MISSING |
Undocumented |
Constant | _OVERFLOW |
Undocumented |
Constant | _PARSING |
Indicates that the NetstringReceiver is in the state of parsing the length portion of a netstring. |
Constant | _PARSING |
Indicates that the NetstringReceiver is in the state of parsing the payload portion (data and trailing comma) of a netstring. |
Constant | _TOO |
Undocumented |
Instance Variable | _current |
Undocumented |
Instance Variable | _expected |
Holds the payload size plus one for the trailing comma. |
Instance Variable | _payload |
Holds the payload portion of a netstring including the trailing comma |
Instance Variable | _remaining |
Holds the chunk of data that has not yet been consumed |
Instance Variable | _state |
Indicates if the protocol is consuming the length portion (PARSING_LENGTH) or the payload (PARSING_PAYLOAD) of a netstring |
Inherited from Protocol
(via NetstringReceiver
):
Method | connection |
Called when the connection is shut down. |
Method | log |
Return a prefix matching the class name, to identify log messages related to this protocol instance. |
Class Variable | factory |
Undocumented |
Inherited from BaseProtocol
(via NetstringReceiver
, Protocol
):
Method | connection |
Called when a connection is made. |
Instance Variable | connected |
Undocumented |
Instance Variable | transport |
Undocumented |