Module Expr Str Import alias Import alias Import alias Import alias Import alias ImportFrom alias ImportFrom alias alias alias alias ImportFrom alias alias alias Assign TupleStore NameStore NameStore NameStore Call NameLoad Num Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr Str Num Num Num Assign NameStore Str For NameStore ListLoad Str Str Str Str body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad Delete NameDel NameDel NameDel Assign NameStore Num ClassDef bases NameLoad body Expr Str decorator_list ClassDef bases NameLoad body Expr Str decorator_list ClassDef bases AttributeLoad NameLoad attr body Expr Str Assign NameStore Num Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Str Assign NameStore Str Assign NameStore Str Assign NameStore Str Assign NameStore Str Assign TupleStore NameStore NameStore Call NameLoad Num FunctionDef arguments args NameParam NameParam defaults body Expr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad Assign AttributeStore NameLoad attr Str Assign AttributeStore NameLoad attr Num Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Num Assign AttributeStore NameLoad attr Num decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If UnaryOpNot Call NameLoad NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad Num Assign NameStore Call NameLoad NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr BinOpMod Str TupleLoad Call NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str AugAssignAdd AttributeStore NameLoad attr NameLoad While AttributeLoad NameLoad attr body TryExcept body Expr Call AttributeLoad NameLoad attr handlers ExceptHandler type NameLoad body Break ExceptHandler type NameLoad body Expr Call AttributeLoad NameLoad attr Break decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Raise Call NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return BinOpAdd Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Num decorator_list FunctionDef arguments args NameParam defaults body Expr Str If CompareEq AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr If CompareEq AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr If UnaryOpNot NameLoad body Expr Call AttributeLoad NameLoad attr Raise Call NameLoad Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr If UnaryOpNot NameLoad body Raise Call NameLoad AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Num Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Num Assign NameStore Call AttributeLoad NameLoad attr Num Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Slice NameLoad Assign AttributeStore NameLoad attr BinOpAdd Call AttributeLoad NameLoad attr NameLoad Num Assign AttributeStore NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Slice NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad NameLoad If CompareGt NameLoad AttributeLoad NameLoad attr body Raise Call NameLoad BinOpMod AttributeLoad NameLoad attr TupleLoad AttributeLoad NameLoad attr Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If CompareGt Call NameLoad NameLoad Call AttributeLoad NameLoad attr body Raise Call NameLoad BinOpMod AttributeLoad NameLoad attr TupleLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Num Expr Call AttributeLoad AttributeLoad NameLoad attr attr Num Expr Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr If CompareLt AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Raise Call NameLoad Expr Call AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str If Call AttributeLoad NameLoad attr body Assign NameStore BinOpSub AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr SubscriptLoad AttributeLoad NameLoad attr Slice NameLoad Assign AttributeStore NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Slice NameLoad Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr orelse Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr AugAssignAdd AttributeStore NameLoad attr Call NameLoad AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return CompareGtE BinOpAdd Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr SubscriptLoad Call AttributeLoad AttributeLoad NameLoad attr attr Slice Num decorator_list FunctionDef arguments args NameParam defaults body Expr Str If CompareNotEq SubscriptLoad Call AttributeLoad AttributeLoad NameLoad attr attr Index Num Str body Raise Call NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr Assign AttributeStore NameLoad attr Num decorator_list decorator_list ClassDef bases AttributeLoad NameLoad attr body Expr Str Assign NameStore Str Assign NameStore Str Assign NameStore Num FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad BinOpAdd AttributeLoad NameLoad attr NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Num For NameStore NameLoad body If AttributeLoad AttributeLoad NameLoad attr attr body Return If CompareGt Call NameLoad NameLoad AttributeLoad NameLoad attr body Return Call AttributeLoad NameLoad attr NameLoad orelse Expr Call AttributeLoad NameLoad attr NameLoad If CompareGt Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Return Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Raise NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Return Call AttributeLoad AttributeLoad NameLoad attr attr TupleLoad NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Return Call AttributeLoad NameLoad attr Str decorator_list decorator_list ClassDef bases body Assign NameStore NameLoad FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr Str decorator_list FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list decorator_list ClassDef bases AttributeLoad NameLoad attr NameLoad body Expr Str Assign NameStore Num Assign NameStore Str Assign NameStore Str Assign NameStore Num FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Str Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign AttributeStore NameLoad attr BinOpAdd AttributeLoad NameLoad attr NameLoad While BoolOpAnd AttributeLoad NameLoad attr UnaryOpNot AttributeLoad NameLoad attr body TryExcept body Assign TupleStore NameStore AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Num handlers ExceptHandler type NameLoad body If CompareGt Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Assign TupleStore NameStore AttributeStore NameLoad attr TupleLoad AttributeLoad NameLoad attr Str Return Call AttributeLoad NameLoad attr NameLoad Break orelse Assign NameStore Call NameLoad NameLoad If CompareGt NameLoad AttributeLoad NameLoad attr body Assign NameStore BinOpAdd NameLoad AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Str Return Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad If BoolOpOr NameLoad BoolOpAnd AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr body Return NameLoad orelse If UnaryOpNot AttributeLoad NameLoad attr body Assign NameStore AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Str If NameLoad body Return Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults Str body Expr Str Assign AttributeStore NameLoad attr Num If NameLoad body Return Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign AttributeStore NameLoad attr Num decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Raise NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Raise NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Return Call AttributeLoad AttributeLoad NameLoad attr attr BinOpAdd NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Return Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list decorator_list ClassDef bases NameLoad body Expr Str decorator_list ClassDef bases AttributeLoad NameLoad attr NameLoad body Expr Str Assign NameStore Num Assign NameStore Str FunctionDef arguments args NameParam NameParam defaults body Expr Str Raise NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign AttributeStore NameLoad attr BinOpAdd AttributeLoad NameLoad attr NameLoad While BoolOpAnd CompareGtE Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr UnaryOpNot AttributeLoad NameLoad attr body Assign TupleStore NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Slice AttributeLoad NameLoad attr If CompareGt NameLoad AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr NameLoad Return If CompareLt Call NameLoad AttributeLoad NameLoad attr BinOpAdd NameLoad AttributeLoad NameLoad attr body Break Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Slice AttributeLoad NameLoad attr BinOpAdd NameLoad AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Slice BinOpAdd NameLoad AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If CompareGtE Call NameLoad NameLoad BinOpPow Num BinOpMult Num AttributeLoad NameLoad attr body Raise Call NameLoad BinOpMod Str TupleLoad Call NameLoad NameLoad BinOpPow Num BinOpMult Num AttributeLoad NameLoad attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr BinOpAdd Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Call NameLoad NameLoad NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad decorator_list ClassDef bases body Expr Str Assign NameStore Str FunctionDef arguments args NameParam NameParam defaults body Expr Str TryExcept body Assign NameStore BinOpAdd Str AttributeLoad NameLoad attr Assign NameStore Call NameLoad NameLoad NameLoad handlers ExceptHandler type NameLoad body Expr Call AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr Str orelse Assign AttributeStore NameLoad attr Call NameLoad NameLoad If CompareEq AttributeLoad NameLoad attr Str body Expr Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list decorator_list ClassDef bases body Expr Str Expr Call NameLoad AttributeLoad NameLoad attr Assign NameStore BinOpPow Num Num Assign NameStore Str Assign NameStore NameLoad FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad body Expr Str Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Str If AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr If UnaryOpNot NameLoad body Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr If AttributeLoad NameLoad attr body Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad Return If AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign AttributeStore NameLoad attr SubscriptLoad NameLoad Index Num decorator_list FunctionDef arguments args NameParam defaults body Pass decorator_list FunctionDef arguments args NameParam defaults body If AttributeLoad NameLoad attr body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Call NameLoad Str Assign AttributeStore NameLoad attr NameLoad decorator_list decorator_list
N/A N/A 
Basic protocols, such as line-oriented, netstring, and int prefixed strings.

Maintainer: Itamar Shtull-Trauring
 N/A re N/A struct N/A warnings N/A cStringIO N/A math zope.interface implements twisted.internet protocol defer interfaces error twisted.python log deprecate versions N/A N/A LENGTH DATA COMMA N/A range 3 N/A NUMBER N/A N/A re compile (\d*)(:?) N/A deprecatedSince N/A N/A versions Version Twisted 10 2 0 N/A message NetstringReceiver parser state is private. N/A attr N/A LENGTH DATA COMMA NUMBER N/A N/A N/A N/A deprecate deprecatedModuleAttribute deprecatedSince message __name__ attr N/A deprecatedSince message attr N/A DEBUG 0 NetstringParseError N/A ValueError N/A N/A 
    The incoming data is not in valid Netstring format.
     N/A IncompleteNetstring N/A Exception N/A N/A 
    Not enough data to complete a netstring.
     N/A NetstringReceiver N/A N/A protocol Protocol N/A N/A 
    A protocol that sends and receives netstrings.

    See U{http://cr.yp.to/proto/netstrings.txt} for the specification of
    netstrings. Every netstring starts with digits that specify the length
    of the data. This length specification is separated from the data by
    a colon. The data is terminated with a comma.

    Override L{stringReceived} to handle received netstrings. This
    method is called with the netstring payload as a single argument
    whenever a complete netstring is received.

    Security features:
        1. Messages are limited in size, useful if you don't want
           someone sending you a 500MB netstring (change C{self.MAX_LENGTH}
           to the maximum length you wish to accept).
        2. The connection is lost if an illegal message is received.

    @ivar MAX_LENGTH: Defines the maximum length of netstrings that can be
        received.
    @type MAX_LENGTH: C{int}

    @ivar _LENGTH: A pattern describing all strings that contain a netstring
        length specification. Examples for length specifications are '0:',
        '12:', and '179:'. '007:' is no valid length specification, since
        leading zeros are not allowed.
    @type _LENGTH: C{re.Match}

    @ivar _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.
    @type _LENGTH_PREFIX: C{re.Match}

    @ivar _PARSING_LENGTH: Indicates that the C{NetstringReceiver} is in
        the state of parsing the length portion of a netstring.
    @type _PARSING_LENGTH: C{int}

    @ivar _PARSING_PAYLOAD: Indicates that the C{NetstringReceiver} is in
        the state of parsing the payload portion (data and trailing comma)
        of a netstring.
    @type _PARSING_PAYLOAD: C{int}

    @ivar brokenPeer: Indicates if the connection is still functional
    @type brokenPeer: C{int}

    @ivar _state: Indicates if the protocol is consuming the length portion
        (C{PARSING_LENGTH}) or the payload (C{PARSING_PAYLOAD}) of a netstring
    @type _state: C{int}

    @ivar _remainingData: Holds the chunk of data that has not yet been consumed
    @type _remainingData: C{string}

    @ivar _payload: Holds the payload portion of a netstring including the
        trailing comma
    @type _payload: C{cStringIO.StringIO}

    @ivar _expectedPayloadSize: Holds the payload size plus one for the trailing
        comma.
    @type _expectedPayloadSize: C{int}
     N/A MAX_LENGTH 99999 N/A _LENGTH N/A N/A re compile (0|[1-9]\d*)(:) N/A _LENGTH_PREFIX N/A N/A re compile (0|[1-9]\d*)$ N/A _MISSING_LENGTH The received netstring does not start with a length specification. N/A _OVERFLOW The length specification of the received netstring cannot be represented in Python - it causes an OverflowError! N/A _TOO_LONG The received netstring is longer than the maximum %s specified by self.MAX_LENGTH N/A _MISSING_COMMA The received netstring is not terminated by a comma. N/A _DATA_SUPPORT_DEPRECATED Data passed to sendString() must be a string. Non-string support is deprecated since Twisted 10.0 N/A N/A _PARSING_LENGTH _PARSING_PAYLOAD N/A range 2 makeConnection N/A N/A self transport N/A N/A N/A 
        Initializes the protocol.
         N/A N/A N/A N/A protocol Protocol makeConnection self transport N/A N/A self _remainingData N/A N/A self _currentPayloadSize 0 N/A N/A self _payload N/A N/A cStringIO StringIO N/A N/A self _state N/A self _PARSING_LENGTH N/A N/A self _expectedPayloadSize 0 N/A N/A self brokenPeer 0 N/A sendString N/A N/A self string N/A N/A N/A 
        Sends a netstring.

        Wraps up C{string} by adding length information and a
        trailing comma; writes the result to the transport.

        @param string: The string to send.  The necessary framing (length
            prefix, etc) will be added.
        @type string: C{str}
         N/A N/A N/A isinstance string str N/A N/A N/A N/A warnings warn N/A self _DATA_SUPPORT_DEPRECATED DeprecationWarning 2 N/A string N/A str string N/A N/A N/A N/A self transport write N/A %d:%s, N/A N/A len string string N/A dataReceived N/A N/A self data N/A N/A N/A 
        Receives some characters of a netstring.

        Whenever a complete netstring is received, this method extracts
        its payload and calls L{stringReceived} to process it.

        @param data: A chunk of data representing a (possibly partial)
            netstring
        @type data: C{str}
         N/A N/A self _remainingData data N/A N/A self _remainingData N/A N/A N/A N/A N/A N/A self _consumeData N/A N/A N/A IncompleteNetstring N/A N/A N/A N/A NetstringParseError N/A N/A N/A N/A self _handleParseError N/A N/A stringReceived N/A N/A self string N/A N/A N/A 
        Override this for notification when each complete string is received.

        @param string: The complete string which was received with all
            framing (length prefix, etc) removed.
        @type string: C{str}

        @raise NotImplementedError: because the method has to be implemented
            by the child class.
         N/A N/A NotImplementedError N/A _maxLengthSize N/A N/A self N/A N/A N/A 
        Calculate and return the string size of C{self.MAX_LENGTH}.

        @return: The size of the string representation for C{self.MAX_LENGTH}
        @rtype: C{float}
         N/A N/A N/A N/A math ceil N/A N/A math log10 N/A self MAX_LENGTH 1 N/A _consumeData N/A N/A self N/A N/A N/A 
        Consumes the content of C{self._remainingData}.

        @raise IncompleteNetstring: if C{self._remainingData} does not
            contain enough data to complete the current netstring.
        @raise NetstringParseError: if the received data do not
            form a valid netstring.
         N/A N/A N/A self _state N/A self _PARSING_LENGTH N/A N/A N/A N/A self _consumeLength N/A N/A N/A self _prepareForPayloadConsumption N/A N/A N/A self _state N/A self _PARSING_PAYLOAD N/A N/A N/A N/A self _consumePayload N/A _consumeLength N/A N/A self N/A N/A N/A 
        Consumes the length portion of C{self._remainingData}.

        @raise IncompleteNetstring: if C{self._remainingData} contains
            a partial length specification (digits without trailing
            comma).
        @raise NetstringParseError: if the received data do not form a valid
            netstring.
         N/A lengthMatch N/A N/A N/A self _LENGTH match N/A self _remainingData N/A N/A lengthMatch N/A N/A N/A N/A self _checkPartialLengthSpecification N/A N/A IncompleteNetstring N/A N/A N/A self _processLength lengthMatch N/A _checkPartialLengthSpecification N/A N/A self N/A N/A N/A 
        Makes sure that the received data represents a valid number.

        Checks if C{self._remainingData} represents a number smaller or
        equal to C{self.MAX_LENGTH}.

        @raise NetstringParseError: if C{self._remainingData} is no
            number or is too big (checked by L{extractLength}).
         N/A partialLengthMatch N/A N/A N/A self _LENGTH_PREFIX match N/A self _remainingData N/A N/A partialLengthMatch N/A N/A N/A NetstringParseError N/A self _MISSING_LENGTH N/A lengthSpecification N/A N/A partialLengthMatch group 1 N/A N/A N/A self _extractLength lengthSpecification N/A _processLength N/A N/A self lengthMatch N/A N/A N/A 
        Processes the length definition of a netstring.

        Extracts and stores in C{self._expectedPayloadSize} the number
        representing the netstring size.  Removes the prefix
        representing the length specification from
        C{self._remainingData}.

        @raise NetstringParseError: if the received netstring does not
            start with a number or the number is bigger than
            C{self.MAX_LENGTH}.
        @param lengthMatch: A regular expression match object matching
            a netstring length specification
        @type lengthMatch: C{re.Match}
         N/A endOfNumber N/A N/A lengthMatch end 1 N/A startOfData N/A N/A lengthMatch end 2 N/A lengthString N/A N/A self _remainingData N/A endOfNumber N/A N/A self _expectedPayloadSize N/A N/A N/A self _extractLength lengthString 1 N/A N/A self _remainingData N/A N/A self _remainingData N/A startOfData N/A _extractLength N/A N/A self lengthAsString N/A N/A N/A 
        Attempts to extract the length information of a netstring.

        @raise NetstringParseError: if the number is bigger than
            C{self.MAX_LENGTH}.
        @param lengthAsString: A chunk of data starting with a length
            specification
        @type lengthAsString: C{str}
        @return: The length of the netstring
        @rtype: C{int}
         N/A N/A N/A self _checkStringSize lengthAsString N/A length N/A int lengthAsString N/A N/A length N/A self MAX_LENGTH N/A N/A N/A NetstringParseError N/A N/A self _TOO_LONG N/A N/A self MAX_LENGTH N/A length N/A _checkStringSize N/A N/A self lengthAsString N/A N/A N/A 
        Checks the sanity of lengthAsString.

        Checks if the size of the length specification exceeds the
        size of the string representing self.MAX_LENGTH. If this is
        not the case, the number represented by lengthAsString is
        certainly bigger than self.MAX_LENGTH, and a
        NetstringParseError can be raised.

        This method should make sure that netstrings with extremely
        long length specifications are refused before even attempting
        to convert them to an integer (which might trigger a
        MemoryError).
         N/A N/A N/A len lengthAsString N/A N/A self _maxLengthSize N/A N/A N/A NetstringParseError N/A N/A self _TOO_LONG N/A N/A self MAX_LENGTH N/A _prepareForPayloadConsumption N/A N/A self N/A N/A N/A 
        Sets up variables necessary for consuming the payload of a netstring.
         N/A N/A self _state N/A self _PARSING_PAYLOAD N/A N/A self _currentPayloadSize 0 N/A N/A N/A N/A self _payload seek 0 N/A N/A N/A N/A self _payload truncate N/A _consumePayload N/A N/A self N/A N/A N/A 
        Consumes the payload portion of C{self._remainingData}.

        If the payload is complete, checks for the trailing comma and
        processes the payload. If not, raises an L{IncompleteNetstring}
        exception.

        @raise IncompleteNetstring: if the payload received so far
            contains fewer characters than expected.
        @raise NetstringParseError: if the payload does not end with a
        comma.
         N/A N/A N/A self _extractPayload N/A N/A N/A self _currentPayloadSize N/A self _expectedPayloadSize N/A N/A N/A IncompleteNetstring N/A N/A N/A self _checkForTrailingComma N/A N/A self _state N/A self _PARSING_LENGTH N/A N/A N/A self _processPayload N/A _extractPayload N/A N/A self N/A N/A N/A 
        Extracts payload information from C{self._remainingData}.

        Splits C{self._remainingData} at the end of the netstring.  The
        first part becomes C{self._payload}, the second part is stored
        in C{self._remainingData}.

        If the netstring is not yet complete, the whole content of
        C{self._remainingData} is moved to C{self._payload}.
         N/A N/A N/A self _payloadComplete N/A N/A remainingPayloadSize N/A N/A self _expectedPayloadSize N/A self _currentPayloadSize N/A N/A N/A N/A self _payload write N/A N/A self _remainingData N/A remainingPayloadSize N/A N/A self _remainingData N/A N/A self _remainingData N/A remainingPayloadSize N/A N/A self _currentPayloadSize N/A self _expectedPayloadSize N/A N/A N/A N/A N/A self _payload write N/A self _remainingData N/A N/A self _currentPayloadSize N/A len N/A self _remainingData N/A N/A self _remainingData N/A _payloadComplete N/A N/A self N/A N/A N/A 
        Checks if enough data have been received to complete the netstring.

        @return: C{True} iff the received data contain at least as many
            characters as specified in the length section of the
            netstring
        @rtype: C{bool}
         N/A N/A N/A N/A len N/A self _remainingData N/A self _currentPayloadSize N/A self _expectedPayloadSize N/A _processPayload N/A N/A self N/A N/A N/A 
        Processes the actual payload with L{stringReceived}.

        Strips C{self._payload} of the trailing comma and calls
        L{stringReceived} with the result.
         N/A N/A N/A self stringReceived N/A N/A N/A N/A self _payload getvalue N/A -1 N/A _checkForTrailingComma N/A N/A self N/A N/A N/A 
        Checks if the netstring has a trailing comma at the expected position.

        @raise NetstringParseError: if the last payload character is
            anything but a comma.
         N/A N/A N/A N/A N/A N/A self _payload getvalue N/A -1 , N/A N/A N/A NetstringParseError N/A self _MISSING_COMMA N/A _handleParseError N/A N/A self N/A N/A N/A 
        Terminates the connection and sets the flag C{self.brokenPeer}.
         N/A N/A N/A N/A self transport loseConnection N/A N/A self brokenPeer 1 N/A N/A LineOnlyReceiver N/A N/A protocol Protocol N/A N/A 
    A protocol that receives only lines.

    This is purely a speed optimisation over LineReceiver, for the
    cases that raw mode is known to be unnecessary.

    @cvar delimiter: The line-ending delimiter to use. By default this is
                     '\r\n'.
    @cvar MAX_LENGTH: The maximum length of a line to allow (If a
                      sent line is longer than this, the connection is dropped).
                      Default is 16384.
     N/A _buffer N/A delimiter N/A MAX_LENGTH 16384 dataReceived N/A N/A self data N/A N/A N/A 
        Translates bytes into lines, and calls lineReceived.
         N/A lines N/A N/A N/A N/A self _buffer data split N/A self delimiter N/A N/A self _buffer N/A N/A lines pop -1 N/A line lines N/A N/A N/A N/A self transport disconnecting N/A N/A N/A N/A N/A len line N/A self MAX_LENGTH N/A N/A N/A N/A self lineLengthExceeded line N/A N/A N/A N/A self lineReceived line N/A N/A N/A len N/A self _buffer N/A self MAX_LENGTH N/A N/A N/A N/A self lineLengthExceeded N/A self _buffer N/A lineReceived N/A N/A self line N/A N/A N/A 
        Override this for when each line is received.

        @param line: The line which was received with the delimiter removed.
        @type line: C{str}
         N/A NotImplementedError N/A sendLine N/A N/A self line N/A N/A N/A 
        Sends a line to the other end of the connection.

        @param line: The line to send, not including the delimiter.
        @type line: C{str}
         N/A N/A N/A N/A self transport writeSequence N/A line N/A self delimiter N/A lineLengthExceeded N/A N/A self line N/A N/A N/A 
        Called when the maximum line length has been reached.
        Override if it needs to be dealt with in some special way.
         N/A N/A N/A error ConnectionLost Line length exceeded N/A N/A _PauseableMixin N/A N/A N/A paused False pauseProducing N/A N/A self N/A N/A N/A N/A self paused True N/A N/A N/A N/A self transport pauseProducing N/A resumeProducing N/A N/A self N/A N/A N/A N/A self paused False N/A N/A N/A N/A self transport resumeProducing N/A N/A N/A self dataReceived N/A stopProducing N/A N/A self N/A N/A N/A N/A self paused True N/A N/A N/A N/A self transport stopProducing N/A N/A LineReceiver N/A N/A protocol Protocol _PauseableMixin N/A N/A 
    A protocol that receives lines and/or raw data, depending on mode.

    In line mode, each line that's received becomes a callback to
    L{lineReceived}.  In raw data mode, each chunk of raw data becomes a
    callback to L{rawDataReceived}.  The L{setLineMode} and L{setRawMode}
    methods switch between the two modes.

    This is useful for line-oriented protocols such as IRC, HTTP, POP, etc.

    @cvar delimiter: The line-ending delimiter to use. By default this is
                     '\r\n'.
    @cvar MAX_LENGTH: The maximum length of a line to allow (If a
                      sent line is longer than this, the connection is dropped).
                      Default is 16384.
     N/A line_mode 1 N/A __buffer N/A delimiter N/A MAX_LENGTH 16384 clearLineBuffer N/A N/A self N/A N/A N/A 
        Clear buffered data.

        @return: All of the cleared buffered data.
        @rtype: C{str}
         N/A b N/A self __buffer N/A N/A self __buffer N/A b N/A dataReceived N/A N/A self data N/A N/A N/A 
        Protocol.dataReceived.
        Translates bytes into lines, and calls lineReceived (or
        rawDataReceived, depending on mode.)
         N/A N/A self __buffer N/A N/A self __buffer data N/A N/A N/A self line_mode N/A N/A self paused N/A N/A N/A N/A N/A line N/A self __buffer N/A N/A N/A self __buffer split N/A self delimiter 1 N/A N/A N/A ValueError N/A N/A N/A N/A len N/A self __buffer N/A self MAX_LENGTH N/A N/A N/A line N/A self __buffer N/A N/A self __buffer N/A N/A N/A self lineLengthExceeded line N/A N/A N/A linelength N/A len line N/A N/A linelength N/A self MAX_LENGTH N/A N/A exceeded N/A line N/A self __buffer N/A N/A self __buffer N/A N/A N/A self lineLengthExceeded exceeded N/A why N/A N/A self lineReceived line N/A N/A why N/A N/A self transport N/A N/A self transport disconnecting N/A N/A why N/A N/A N/A N/A self paused N/A N/A data N/A self __buffer N/A N/A self __buffer N/A data N/A N/A N/A N/A self rawDataReceived data N/A setLineMode N/A N/A self extra N/A N/A N/A 
        Sets the line-mode of this receiver.

        If you are calling this from a rawDataReceived callback,
        you can pass in extra unhandled data, and that data will
        be parsed for lines.  Further data received will be sent
        to lineReceived rather than rawDataReceived.

        Do not pass extra data if calling this function from
        within a lineReceived callback.
         N/A N/A self line_mode 1 N/A extra N/A N/A N/A N/A self dataReceived extra N/A setRawMode N/A N/A self N/A N/A N/A 
        Sets the raw mode of this receiver.
        Further data received will be sent to rawDataReceived rather
        than lineReceived.
         N/A N/A self line_mode 0 N/A rawDataReceived N/A N/A self data N/A N/A N/A 
        Override this for when raw data is received.
         N/A NotImplementedError N/A lineReceived N/A N/A self line N/A N/A N/A 
        Override this for when each line is received.

        @param line: The line which was received with the delimiter removed.
        @type line: C{str}
         N/A NotImplementedError N/A sendLine N/A N/A self line N/A N/A N/A 
        Sends a line to the other end of the connection.

        @param line: The line to send, not including the delimiter.
        @type line: C{str}
         N/A N/A N/A N/A self transport write N/A line N/A self delimiter N/A lineLengthExceeded N/A N/A self line N/A N/A N/A 
        Called when the maximum line length has been reached.
        Override if it needs to be dealt with in some special way.

        The argument 'line' contains the remainder of the buffer, starting
        with (at least some part) of the line which is too long. This may
        be more than one line, or may be only the initial portion of the
        line.
         N/A N/A N/A N/A self transport loseConnection N/A N/A StringTooLongError N/A AssertionError N/A N/A 
    Raised when trying to send a string too long for a length prefixed
    protocol.
     N/A IntNStringReceiver N/A N/A protocol Protocol _PauseableMixin N/A N/A 
    Generic class for length prefixed protocols.

    @ivar recvd: buffer holding received data when splitted.
    @type recvd: C{str}

    @ivar structFormat: format used for struct packing/unpacking. Define it in
        subclass.
    @type structFormat: C{str}

    @ivar prefixLength: length of the prefix, in bytes. Define it in subclass,
        using C{struct.calcsize(structFormat)}
    @type prefixLength: C{int}
     N/A MAX_LENGTH 99999 N/A recvd stringReceived N/A N/A self string N/A N/A N/A 
        Override this for notification when each complete string is received.

        @param string: The complete string which was received with all
            framing (length prefix, etc) removed.
        @type string: C{str}
         N/A NotImplementedError N/A lengthLimitExceeded N/A N/A self length N/A N/A N/A 
        Callback invoked when a length prefix greater than C{MAX_LENGTH} is
        received.  The default implementation disconnects the transport.
        Override this.

        @param length: The length prefix which was received.
        @type length: C{int}
         N/A N/A N/A N/A self transport loseConnection N/A dataReceived N/A N/A self recd N/A N/A N/A 
        Convert int prefixed strings into calls to stringReceived.
         N/A N/A self recvd N/A N/A self recvd recd N/A N/A N/A N/A len N/A self recvd N/A self prefixLength N/A N/A self paused N/A N/A N/A length N/A N/A struct unpack N/A self structFormat N/A N/A self recvd N/A N/A self prefixLength N/A N/A length N/A self MAX_LENGTH N/A N/A N/A N/A self lengthLimitExceeded length N/A N/A N/A N/A len N/A self recvd N/A length N/A self prefixLength N/A N/A N/A packet N/A N/A self recvd N/A N/A self prefixLength N/A length N/A self prefixLength N/A N/A self recvd N/A N/A self recvd N/A N/A length N/A self prefixLength N/A N/A N/A self stringReceived packet N/A sendString N/A N/A self string N/A N/A N/A 
        Send a prefixed string to the other end of the connection.

        @param string: The string to send.  The necessary framing (length
            prefix, etc) will be added.
        @type string: C{str}
         N/A N/A N/A len string N/A 2 N/A 8 N/A self prefixLength N/A N/A N/A StringTooLongError N/A Try to send %s bytes whereas maximum is %s N/A N/A len string N/A 2 N/A 8 N/A self prefixLength N/A N/A N/A N/A self transport write N/A N/A N/A struct pack N/A self structFormat N/A len string string N/A N/A Int32StringReceiver N/A IntNStringReceiver N/A N/A 
    A receiver for int32-prefixed strings.

    An int32 string is a string prefixed by 4 bytes, the 32-bit length of
    the string encoded in network byte order.

    This class publishes the same interface as NetstringReceiver.
     N/A structFormat !I N/A prefixLength N/A N/A struct calcsize structFormat N/A Int16StringReceiver N/A IntNStringReceiver N/A N/A 
    A receiver for int16-prefixed strings.

    An int16 string is a string prefixed by 2 bytes, the 16-bit length of
    the string encoded in network byte order.

    This class publishes the same interface as NetstringReceiver.
     N/A structFormat !H N/A prefixLength N/A N/A struct calcsize structFormat N/A Int8StringReceiver N/A IntNStringReceiver N/A N/A 
    A receiver for int8-prefixed strings.

    An int8 string is a string prefixed by 1 byte, the 8-bit length of
    the string.

    This class publishes the same interface as NetstringReceiver.
     N/A structFormat !B N/A prefixLength N/A N/A struct calcsize structFormat N/A StatefulStringProtocol N/A N/A N/A 
    A stateful string protocol.

    This is a mixin for string protocols (Int32StringReceiver,
    NetstringReceiver) which translates stringReceived into a callback
    (prefixed with 'proto_') depending on state.

    The state 'done' is special; if a proto_* method returns it, the
    connection will be closed immediately.
     N/A state init stringReceived N/A N/A self string N/A N/A N/A 
        Choose a protocol phase function and call it.

        Call back to the appropriate protocol phase; this begins with
        the function proto_init and moves on to proto_* depending on
        what each proto_* function returns.  (For example, if
        self.proto_init returns 'foo', then self.proto_foo will be the
        next function called when a protocol message is received.
         N/A N/A N/A pto N/A proto_ N/A self state N/A statehandler N/A getattr self pto N/A N/A N/A AttributeError N/A N/A N/A N/A log msg callback N/A self state not found N/A N/A N/A self state N/A statehandler string N/A N/A N/A self state done N/A N/A N/A N/A N/A self transport loseConnection N/A N/A FileSender N/A N/A N/A 
    A producer that sends the contents of a file to a consumer.

    This is a helper for protocols that, at some point, will take a
    file-like object, read its contents, and write them out to the network,
    optionally performing some transformation on the bytes in between.
     N/A N/A implements N/A interfaces IProducer N/A CHUNK_SIZE N/A 2 14 N/A lastSent N/A deferred None beginFileTransfer N/A N/A self file consumer transform N/A None N/A N/A 
        Begin transferring a file

        @type file: Any file-like object
        @param file: The file object to read data from

        @type consumer: Any implementor of IConsumer
        @param consumer: The object to write data to

        @param transform: A callable taking one string argument and returning
        the same.  All bytes read from the file are passed through this before
        being written to the consumer.

        @rtype: C{Deferred}
        @return: A deferred whose callback will be invoked when the file has
        been completely written to the consumer. The last byte written to the
        consumer is passed to the callback.
         N/A N/A self file file N/A N/A self consumer consumer N/A N/A self transform transform N/A N/A self deferred deferred N/A N/A defer Deferred N/A N/A N/A N/A self consumer registerProducer self False N/A deferred N/A resumeProducing N/A N/A self N/A N/A N/A chunk N/A N/A self file N/A N/A chunk N/A N/A N/A self file read N/A self CHUNK_SIZE N/A N/A chunk N/A N/A N/A self file None N/A N/A N/A N/A self consumer unregisterProducer N/A N/A self deferred N/A N/A N/A N/A N/A self deferred callback N/A self lastSent N/A N/A self deferred None N/A N/A N/A self transform N/A N/A chunk N/A N/A self transform chunk N/A N/A N/A N/A self consumer write chunk N/A N/A self lastSent N/A chunk N/A -1 N/A pauseProducing N/A N/A self N/A N/A N/A N/A stopProducing N/A N/A self N/A N/A N/A N/A self deferred N/A N/A N/A N/A N/A self deferred errback N/A Exception Consumer asked us to stop producing N/A N/A self deferred None N/A N/A