[Twisted-Python] delivering application
m at zadka.site.co.il
Fri Oct 24 03:20:22 EDT 2003
On Thu, 23 Oct 2003, Yun Mao <maoy at cis.upenn.edu> wrote:
> For example,
> reactor.connectTCP ( self.remotehost, self.remoteport,
> sfactory, self.timeout, None, self.interface)
> where self.interface='eth1'
> This only works on Linux..
This is exactly the kind of thing beter done with connectWith, and
exactly why we added the connectWith escape-mechanism. You can implement
IConnector, for example, by inheriting from tcp.Connector, overriding
_makeTransport to call your subclass of Client which will override
the constructor to make custom bindings. That might take a few more
lines, on the order of 15 or so, but in return you can use standard
Twisted and you can use other reactors.
connectWith and listenWith are indeed poorly documented. I have opened
issue 367 to handle their documentation, and I hope I'll be able to work
on it soon. Please feel free to send your current diffs-vs-CVS-Twisted
to the issue, it will give me a concrete example to work with.
More information about the Twisted-Python