twisted.protocols.msn.MSNEventBase

Package twisted :: Package protocols :: Module msn :: Class MSNEventBase |
[frames | no frames]

## Class MSNEventBase

    BaseProtocol --+
                   |
            Protocol --+
                       |
            LineReceiver --+
                           |
                          MSNEventBase

Known Subclasses:
  `DispatchClient`, `NotificationClient`, `SwitchboardClient`

This class provides support for handling / dispatching events and is the base class of the three main client protocols (DispatchClient, NotificationClient, SwitchboardClient)

Method Summary
| `__init__(self)`
| ``_createIDMapping`(self, data)` return a unique transaction ID that is mapped internally to a deferred ..
| ``_fireCallback`(self, id, *args)` Fire the callback for the given id if one exists and return 1, else return false
| ``_nextTransactionID`(self)` return a usable transaction ID
| ``checkMessage`(self, message)` process received messages to check for file invitations and typing notifications and other control type messages
| `connectionLost(self, reason)`
| ``connectionMade`(self)` Called when a connection is made.
| ``gotBadLine`(self, line, why)` called when a handler notifies me that this line is broken
| ``gotError`(self, errorCode)` called when the server sends an error which is not in response to a sent command (ie.
| ``gotMessage`(self, message)` called when we receive a message - override in notification and switchboard clients
| `handle_MSG(self, params)`
| ``handle_UNKNOWN`(self, cmd, params)` implement me in subclasses if you want to handle unknown events
| ``lineReceived`(self, line)` Override this for when each line is received.
| ``rawDataReceived`(self, data)` Override this for when raw data is received.
Inherited from LineReceiver
| ``clearLineBuffer`(self)` Clear buffered data.
| ``dataReceived`(self, data)` Protocol.dataReceived.
| ``lineLengthExceeded`(self, line)` Called when the maximum line length has been reached.
| ``sendLine`(self, line)` Sends a line to the other end of the connection.
| ``setLineMode`(self, extra)` Sets the line-mode of this receiver.
| ``setRawMode`(self)` Sets the raw mode of this receiver.
Inherited from Protocol
| ``connectionFailed`(self)` (Deprecated)
Inherited from BaseProtocol
| ``makeConnection`(self, transport)` Make a connection to a transport and a server.

Class Variable Summary
Inherited from LineReceiver
`str` | `_LineReceiver__buffer` = `''`
`str` | `delimiter`: The line-ending delimiter to use.
`int` | `line_mode` = 1
`int` | `MAX_LENGTH`: The maximum length of a line to allow (If a sent line is longer than this, the connection is dropped).
Inherited from Protocol
`tuple` | `__implements__` = `(<class twisted.internet.interfaces.IPr...`
Inherited from BaseProtocol
`int` | `connected` = 0
`NoneType` | `transport` = None

Method Details

### _createIDMapping(self, data=None) return a unique transaction ID that is mapped internally to a deferred .. also store arbitrary data if it is needed

### _fireCallback(self, id, *args) Fire the callback for the given id if one exists and return 1, else return false

### _nextTransactionID(self) return a usable transaction ID

### checkMessage(self, message) process received messages to check for file invitations and typing notifications and other control type messages

### connectionMade(self) Called when a connection is made. This may be considered the initializer of the protocol, because it is called when the connection is completed. For clients, this is called once the connection to the server has been established; for servers, this is called after an accept() call stops blocking and a socket has been received. If you need to send any greeting or initial message, do it here. Overrides: `twisted.internet.protocol.BaseProtocol.connectionMade` (inherited documentation)

### gotBadLine(self, line, why) called when a handler notifies me that this line is broken

### gotError(self, errorCode) called when the server sends an error which is not in response to a sent command (ie. it has no matching transaction ID)

### gotMessage(self, message) called when we receive a message - override in notification and switchboard clients

### handle_UNKNOWN(self, cmd, params) implement me in subclasses if you want to handle unknown events

### lineReceived(self, line) Override this for when each line is received. Overrides: `twisted.protocols.basic.LineReceiver.lineReceived` (inherited documentation)

### rawDataReceived(self, data) Override this for when raw data is received. Overrides: `twisted.protocols.basic.LineReceiver.rawDataReceived` (inherited documentation)

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