<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Apr 8, 2013, at 3:47 PM, Laurens Van Houtven <_@lvh.cc> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><p style="font-family: Menlo; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">On Apr 8, 2013 9:44 PM, "Phil Budne" <<a href="mailto:phil@ultimate.com">phil@ultimate.com</a>> wrote:<br>> As a quick crock, I made my transport a subclass of<br>> twisted.internet.tcp.Server, and got away with it, but I'd like to do<br>> the right thing.<br>><br>> I'd be delighted to find out that mixins exist that would solve my<br>> problem, but I'd be happy to know what interfaces I need to implement,<br>> or even better where I find find documentation on how to implement a<br>> new "transport", especially one that isn't file-descriptor based.</p><p style="font-family: Menlo; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">Are you familiar with interfaces? ITransport sounds like what you want.</p><br class="Apple-interchange-newline"></blockquote></div><br><div>Saying that ITransport is sufficient is unfortunately a bit simplistic. I am not sure about our HTTP server, but many protocols rely on other interfaces provided by Server, including:</div><div><br></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;"><div><div>>>> from twisted.internet.tcp import Server</div></div><div><div>>>> from zope.interface import implementedBy</div></div><div><div>>>> from pprint import pprint</div></div><div><div>>>> from twisted.python.reflect import qual</div><div>>>> pprint([qual(x) for x in implementedBy(Server)])</div><div>['twisted.internet.interfaces.ITCPTransport',</div><div> 'twisted.internet.interfaces.ISystemHandle',</div><div> 'twisted.internet.interfaces.ITLSTransport',</div><div> 'twisted.internet.interfaces.IPushProducer',</div><div> 'twisted.internet.interfaces.IReadWriteDescriptor',</div><div> 'twisted.internet.interfaces.IConsumer',</div><div> 'twisted.internet.interfaces.ITransport',</div><div> 'twisted.internet.interfaces.IHalfCloseableDescriptor',</div><div> 'twisted.internet.interfaces.ILoggingContext']</div></div></blockquote><br><div>It might be useful to note the possible presence of some of these in the documentation for servers and clients.</div><div><br></div><div>-glyph</div><div><br></div></body></html>