class documentation

Undocumented

Method stringReceived Override this for notification when each complete string is received.

Inherited from TestMixin:

Method connectionLost Undocumented
Method connectionMade Undocumented
Constant MAX_LENGTH Undocumented
Instance Variable closed Undocumented
Instance Variable received Undocumented

Inherited from NetstringReceiver (via TestMixin):

Method dataReceived Receives some characters of a netstring.
Method makeConnection Initializes the protocol.
Method sendString Sends a netstring.
Instance Variable brokenPeer Indicates if the connection is still functional
Method _checkForTrailingComma Checks if the netstring has a trailing comma at the expected position.
Method _checkPartialLengthSpecification Makes sure that the received data represents a valid number.
Method _checkStringSize Checks the sanity of lengthAsString.
Method _consumeData Consumes the content of self._remainingData.
Method _consumeLength Consumes the length portion of self._remainingData.
Method _consumePayload Consumes the payload portion of self._remainingData.
Method _extractLength Attempts to extract the length information of a netstring.
Method _extractPayload Extracts payload information from self._remainingData.
Method _handleParseError Terminates the connection and sets the flag self.brokenPeer.
Method _maxLengthSize Calculate and return the string size of self.MAX_LENGTH.
Method _payloadComplete Checks if enough data have been received to complete the netstring.
Method _prepareForPayloadConsumption Sets up variables necessary for consuming the payload of a netstring.
Method _processLength Processes the length definition of a netstring.
Method _processPayload 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_PREFIX 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_COMMA Undocumented
Constant _MISSING_LENGTH Undocumented
Constant _OVERFLOW Undocumented
Constant _PARSING_LENGTH Indicates that the NetstringReceiver is in the state of parsing the length portion of a netstring.
Constant _PARSING_PAYLOAD Indicates that the NetstringReceiver is in the state of parsing the payload portion (data and trailing comma) of a netstring.
Constant _TOO_LONG Undocumented
Instance Variable _currentPayloadSize Undocumented
Instance Variable _expectedPayloadSize 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 _remainingData 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 TestMixin, NetstringReceiver):

Method logPrefix Return a prefix matching the class name, to identify log messages related to this protocol instance.
Class Variable factory Undocumented

Inherited from BaseProtocol (via TestMixin, NetstringReceiver, Protocol):

Instance Variable connected Undocumented
Instance Variable transport Undocumented
def stringReceived(self, s): (source)

Override this for notification when each complete string is received.

Parameters
sUndocumented
string:bytesThe complete string which was received with all framing (length prefix, etc) removed.
Raises
NotImplementedErrorbecause the method has to be implemented by the child class.