<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 &lt;_@lvh.cc&gt; 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" &lt;<a href="mailto:phil@ultimate.com">phil@ultimate.com</a>&gt; wrote:<br>&gt; As a quick crock, I made my transport a subclass of<br>&gt; twisted.internet.tcp.Server, and got away with it, but I'd like to do<br>&gt; the right thing.<br>&gt;<br>&gt; I'd be delighted to find out that mixins exist that would solve my<br>&gt; problem, but I'd be happy to know what interfaces I need to implement,<br>&gt; or even better where I find find documentation on how to implement a<br>&gt; 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. &nbsp;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>&gt;&gt;&gt; from twisted.internet.tcp import Server</div></div><div><div>&gt;&gt;&gt; from zope.interface import implementedBy</div></div><div><div>&gt;&gt;&gt; from pprint import pprint</div></div><div><div>&gt;&gt;&gt; from twisted.python.reflect import qual</div><div>&gt;&gt;&gt; pprint([qual(x) for x in implementedBy(Server)])</div><div>['twisted.internet.interfaces.ITCPTransport',</div><div>&nbsp;'twisted.internet.interfaces.ISystemHandle',</div><div>&nbsp;'twisted.internet.interfaces.ITLSTransport',</div><div>&nbsp;'twisted.internet.interfaces.IPushProducer',</div><div>&nbsp;'twisted.internet.interfaces.IReadWriteDescriptor',</div><div>&nbsp;'twisted.internet.interfaces.IConsumer',</div><div>&nbsp;'twisted.internet.interfaces.ITransport',</div><div>&nbsp;'twisted.internet.interfaces.IHalfCloseableDescriptor',</div><div>&nbsp;'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>