Package Honey :: Module Protocol :: Class LineProtocol
[show private | hide private]
[frames | no frames]

Class LineProtocol

  object --+        
           |        
BaseProtocol --+    
               |    
     RawProtocol --+
                   |
                  LineProtocol

Known Subclasses:
FakeHTTP, FakePOP3, FakeSMTP, MyLineProtocol

Line oriented protocol. Send and receive data line by line
Method Summary
a new object with type S, a subtype of T __new__(S, ...)
  connectionEstablished(self)
Callback called when the connection is established (inherited from BaseProtocol)
  connectionLost(self)
Callback called when the connection is lost (inherited from BaseProtocol)
  dataReceived(self, data)
Process received data into lines
  lineLengthExceeded(self, line)
Callback called when a line exceeeds max length
  lineReceived(self, line)
Callback
  rawDataReceived(self, data)
Callback
  sendline(self, line)
Send a line.
  setLineMode(self, extra)
Enter line mode
  setRawMode(self)
Enter Raw mode

Class Variable Summary
str delimiter
bool lineMode
int MAX

Method Details

__new__(S, ...)

Returns:
a new object with type S, a subtype of T

dataReceived(self, data)

Process received data into lines

lineLengthExceeded(self, line)

Callback called when a line exceeeds max length

This default implementation simply close the socket.

Override it if this is not the desired behavior

lineReceived(self, line)

Callback

Should be overriden

rawDataReceived(self, data)

Callback

Should be overriden

sendline(self, line)

Send a line. Use this method instead of 'send'

setLineMode(self, extra='')

Enter line mode

setRawMode(self)

Enter Raw mode

Class Variable Details

delimiter

Type:
str
Value:
'''\r
'''                                                                    

lineMode

Type:
bool
Value:
True                                                                   

MAX

Type:
int
Value:
16384                                                                  

Generated by Epydoc 1.1 on Sun Dec 7 16:05:42 2003 http://epydoc.sf.net