[Twisted-Python] Custom transports

Hello, What would I do to implement a custom transport within the Twisted framework? That is, I'd like to be able to add custom listen___ and connect___ methods to the reactor, so that existing protocols can run over a new backend transport protocol. What API would I use for this? -- Adam

On Thu, 2005-12-22 at 18:34 -0500, Adam Atlas wrote:
If this transport is implemented in terms of other protocols, it doesn't have to be a reactor method. For example, lets say you write a SOCKSv4 transport; the way users would use it is probably: mySocksProxy = SOCKSProxy('myproxy.example.com', 9999) mySocksProxy.listenTCP(8080, SomeFactory()) Even if it requires registering file descriptors, you don't *have* to add reactor.* methods (see e.g. twisted.internet.stdio).

On 12/24/05, Itamar Shtull-Trauring <itamar@itamarst.org> wrote:
Also, the reactor has a method listenWith that may be useful. See the docs for it in twisted.internet.interfaces. -- Twisted | Christopher Armstrong: International Man of Twistery Radix | -- http://radix.twistedmatrix.com | Release Manager, Twisted Project \\\V/// | -- http://twistedmatrix.com |o O| | w----v----w-+

On Thu, 2005-12-22 at 18:34 -0500, Adam Atlas wrote:
If this transport is implemented in terms of other protocols, it doesn't have to be a reactor method. For example, lets say you write a SOCKSv4 transport; the way users would use it is probably: mySocksProxy = SOCKSProxy('myproxy.example.com', 9999) mySocksProxy.listenTCP(8080, SomeFactory()) Even if it requires registering file descriptors, you don't *have* to add reactor.* methods (see e.g. twisted.internet.stdio).

On 12/24/05, Itamar Shtull-Trauring <itamar@itamarst.org> wrote:
Also, the reactor has a method listenWith that may be useful. See the docs for it in twisted.internet.interfaces. -- Twisted | Christopher Armstrong: International Man of Twistery Radix | -- http://radix.twistedmatrix.com | Release Manager, Twisted Project \\\V/// | -- http://twistedmatrix.com |o O| | w----v----w-+
participants (3)
-
Adam Atlas
-
Christopher Armstrong
-
Itamar Shtull-Trauring