Package twisted :: Package protocols :: Module policies :: Class ThrottlingProtocol
[show private | hide private]
[frames | no frames]

Class ThrottlingProtocol

BaseProtocol --+        
               |        
        Protocol --+    
                   |    
     ProtocolWrapper --+
                       |
                      ThrottlingProtocol


Protocol for ThrottlingFactory.
Method Summary
  __init__(self, factory, wrappedProtocol)
(inherited from ProtocolWrapper)
  connectionFailed(self)
(Deprecated) (inherited from Protocol)
  connectionLost(self, reason)
(inherited from ProtocolWrapper)
  connectionMade(self)
Called when a connection is made. (inherited from ProtocolWrapper)
  dataReceived(self, data)
Called whenever data is received.
  getHost(self)
(inherited from ProtocolWrapper)
  getPeer(self)
(inherited from ProtocolWrapper)
  loseConnection(self)
(inherited from ProtocolWrapper)
  registerProducer(self, producer, streaming)
  stopConsuming(self)
(inherited from ProtocolWrapper)
  throttleReads(self)
  throttleWrites(self)
  unregisterProducer(self)
  unthrottleReads(self)
  unthrottleWrites(self)
  write(self, data)
  writeSequence(self, seq)

Method Details

dataReceived(self, data)

Called whenever data is received.

Use this method to translate to a higher-level message. Usually, some callback will be made upon the receipt of each complete protocol message.
Parameters:
data - a string of indeterminate length. Please keep in mind that you will probably need to buffer some data, as partial (or multiple) protocol messages may be received! I recommend that unit tests for protocols call through to this method with differing chunk sizes, down to one byte at a time.
Overrides:
twisted.protocols.policies.ProtocolWrapper.dataReceived (inherited documentation)

Generated by Epydoc 1.2 prerelease on Wed Jan 29 06:25:54 2003 http://epydoc.sf.net