Package twisted :: Package internet :: Module interfaces :: Class IProtocolFactory

[frames | no frames]

## Class IProtocolFactory

    Interface --+
                |
               IProtocolFactory

Interface for protocol factories.

Method Summary
| ``buildProtocol`(self, addr)` Return an object implementing `IProtocol`, or None.
| ``doStart`(self)` Called every time this is connected to a Port or Connector.
| ``doStop`(self)` Called every time this is unconnected from a Port or Connector.

Method Details

### buildProtocol(self, addr)

Return an object implementing `IProtocol`, or None.

This method will be called when a connection has been established to addr.

If None is returned, the connection is assumed to have been refused, and the Port will close the connection.

TODO:

- Document 'addr' argument -- what format is it in?
- Is the phrase "incoming server connection" correct when Factory is a ClientFactory?

### doStart(self)

Called every time this is connected to a Port or Connector.

### doStop(self)

Called every time this is unconnected from a Port or Connector.

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