Package twisted :: Package protocols :: Module policies :: Class SpewingProtocol

[show private | hide private]
[frames | no frames]

## Class SpewingProtocol

    BaseProtocol --+
                   |
            Protocol --+
                       |
         ProtocolWrapper --+
                           |
                          SpewingProtocol

Method Summary
| `__init__(self, factory, wrappedProtocol)` (inherited from `ProtocolWrapper`)
| ``connectionFailed`(self)` (Deprecated) (inherited from `Protocol`)
| ``connectionLost`(self, reason)` Called when the connection is shut down. (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`)
| ``makeConnection`(self, transport)` Make a connection to a transport and a server. (inherited from `BaseProtocol`)
| `registerProducer(self, producer, streaming)` (inherited from `ProtocolWrapper`)
| `stopConsuming(self)` (inherited from `ProtocolWrapper`)
| `unregisterProducer(self)` (inherited from `ProtocolWrapper`)
| `write(self, data)`
| `writeSequence(self, data)` (inherited from `ProtocolWrapper`)

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.1 on Thu May 8 13:18:54 2003 | http://epydoc.sf.net