Package twisted :: Package protocols :: Module basic :: Class LineOnlyReceiver
[frames | no frames]

Class LineOnlyReceiver

BaseProtocol --+    
               |    
        Protocol --+
                   |
                  LineOnlyReceiver

Known Subclasses:
LogWatcher

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.
Method Summary
  dataReceived(self, data)
Translates bytes into lines, and calls lineReceived.
  lineLengthExceeded(self, line)
Called when the maximum line length has been reached.
  lineReceived(self, line)
Override this for when each line is received.
  sendLine(self, line)
Sends a line to the other end of the connection.
    Inherited from Protocol
  connectionLost(self, reason)
Called when the connection is shut down.

Class Variable Summary
str delimiter: The line-ending delimiter to use.
int MAX_LENGTH: The maximum length of a line to allow (If a sent line is longer than this, the connection is dropped).
    Inherited from Protocol
Implements __implemented__ = <implementedBy twisted.internet.protoc...
ClassProvides __provides__ = <zope.interface.declarations.ClassProvide...

Method Details

dataReceived(self, data)

Translates bytes into lines, and calls lineReceived.
Overrides:
twisted.internet.protocol.Protocol.dataReceived

lineLengthExceeded(self, line)

Called when the maximum line length has been reached. Override if it needs to be dealt with in some special way.

lineReceived(self, line)

Override this for when each line is received.

sendLine(self, line)

Sends a line to the other end of the connection.

Class Variable Details

delimiter

The line-ending delimiter to use. By default this is '\r\n'.
Type:
str
Value:
'''\r
'''                                                                    

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.
Type:
int
Value:
16384                                                                 

Generated by Epydoc 2.1 on Sun Dec 10 22:04:45 2006 http://epydoc.sf.net