Home | Trees | Index | Help |
---|
Package twisted :: Package protocols :: Module basic :: Class LineReceiver |
|
BaseProtocol
--+ |Protocol
--+ | LineReceiver
HTTPChannel
,
IRCClient
,
POP3
,
SMTP
,
SMTPClient
,
NNTPServer
,
DictClient
,
Finger
,
FTP
,
FTPFileListProtocol
,
FTPClient
,
GnutellaTalker
,
HTTPClient
,
IMAP4Server
,
IMAP4Client
,
DccChat
,
MSNEventBase
,
MSNFileSend
,
MSNFileReceive
,
NNTPClient
,
POP3Client
,
MessagesParser
,
NMEAReceiver
,
LineLogger
,
FlashConduit
A protocol that receives lines and/or raw data, depending on mode.
In line mode, each line that's received becomes a callback to lineReceived
. In raw data mode, each chunk
of raw data becomes a callback to rawDataReceived
. The setLineMode
and setRawMode
methods switch between the two
modes.
Method Summary | |
---|---|
Clear buffered data. | |
(Deprecated) (inherited from Protocol )
| |
Called when the connection is shut down. (inherited from Protocol )
| |
Called when a connection is made. (inherited from BaseProtocol )
| |
Protocol.dataReceived. | |
Called when the maximum line length has been reached. | |
Override this for when each line is received. | |
Make a connection to a transport and a server. (inherited from BaseProtocol )
| |
Override this for when raw data is received. | |
Sends a line to the other end of the connection. | |
Sets the line-mode of this receiver. | |
Sets the raw mode of this receiver. |
Class Variable Summary | |
---|---|
str |
delimiter
- The line-ending delimiter to use. |
int |
line_mode
|
int |
MAX_LENGTH
- The maximum length of a line to allow (If a sent line is longer than
this, the connection is dropped). |
str |
_LineReceiver__buffer
|
Method Details |
---|
clearLineBuffer(self)Clear buffered data. |
dataReceived(self, data)Protocol.dataReceived. Translates bytes into lines, and calls lineReceived (or rawDataReceived, depending on mode.) |
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. |
rawDataReceived(self, data)Override this for when raw data is received. |
sendLine(self, line)Sends a line to the other end of the connection. |
setLineMode(self, extra='')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. |
setRawMode(self)Sets the raw mode of this receiver. Further data received will be sent to rawDataReceived rather than lineReceived. |
Class Variable Details |
---|
delimiterThe line-ending delimiter to use. By default this is '\r\n'.
|
line_mode
|
MAX_LENGTHThe maximum length of a line to allow (If a sent line is longer than this, the connection is dropped). Default is 16834.
|
_LineReceiver__buffer
|
Home | Trees | Index | Help |
---|
Generated by Epydoc 1.1 on Fri Jun 27 03:48:25 2003 | http://epydoc.sf.net |