twisted.protocols.basic.Int32StringReceiver

Package twisted :: Package protocols :: Module basic :: Class Int32StringReceiver |
[frames | no frames]

## Class Int32StringReceiver

    BaseProtocol --+
                   |
            Protocol --+
                       |
                      Int32StringReceiver

A receiver for int32-prefixed strings.

An int32 string is a string prefixed by 4 bytes, the 32-bit length of the string encoded in network byte order.

This class publishes the same interface as NetstringReceiver.

Method Summary
| ``dataReceived`(self, recd)` Convert int32 prefixed strings into calls to stringReceived.
| ``sendString`(self, data)` Send an int32-prefixed string to the other end of the connection.
| ``stringReceived`(self, msg)` Override this.
Inherited from Protocol
| ``connectionFailed`(self)` (Deprecated)
| ``connectionLost`(self, reason)` Called when the connection is shut down.
Inherited from BaseProtocol
| ``connectionMade`(self)` Called when a connection is made.
| ``makeConnection`(self, transport)` Make a connection to a transport and a server.

Class Variable Summary
`int` | `MAX_LENGTH` = 99999
`str` | `recvd` = `''`
Inherited from Protocol
`tuple` | `__implements__` = `(<class twisted.internet.interfaces.IPr...`
Inherited from BaseProtocol
`int` | `connected` = 0
`NoneType` | `transport` = None

Method Details

### dataReceived(self, recd) Convert int32 prefixed strings into calls to stringReceived. Overrides: `twisted.internet.protocol.Protocol.dataReceived`

### sendString(self, data) Send an int32-prefixed string to the other end of the connection.

### stringReceived(self, msg) Override this.

Class Variable Details

    ### MAX_LENGTH Type: `int` Value:
        99999

    ### recvd Type: `str` Value:
        ''

Generated by Epydoc 2.0 on Sat May 15 20:08:15 2004 | http://epydoc.sf.net