Table of Contents

Class: LineReceiver | Twisted-0.17.4/twisted/protocols/basic.py
--- | ---

### A protocol which has a mode where it receives lines, and a mode where it receives raw data.

Each line that's received becomes a callback to lineReceived. Each chunk of raw data becomes a callback to rawDataReceived.

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

Base Classes |
--- | ---
protocol.Protocol

Methods |
--- | ---
dataReceived lineReceived rawDataReceived sendLine setLineMode setRawMode
| dataReceived

    dataReceived ( self,  data )

Protocol.dataReceived. Translates bytes into lines, and calls lineReceived (or rawDataReceived, depending on mode.)

| lineReceived

    lineReceived ( self,  line )

Override this for when each line is received.

Exceptions |
--- | ---
NotImplementedError

| rawDataReceived

    rawDataReceived ( self,  data )

Override this for when raw data is received.

Exceptions |
--- | ---
NotImplementedError

| sendLine

    sendLine ( self,  line )

Sends a line to the other end of the connection.

| setLineMode

    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

    setRawMode ( self )

Sets the raw mode of this receiver. Further data received will be sent to rawDataReceived rather than lineReceived.

Table of Contents

This document was automatically generated on Sat Apr 20 01:31:04 2002 by HappyDoc version 2.0