<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On Jul 12, 2013, at 5:09 AM, <a href="mailto:exarkun@twistedmatrix.com">exarkun@twistedmatrix.com</a> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">On 10:42 am,<span class="Apple-converted-space"> </span><a href="mailto:p.mayers@imperial.ac.uk">p.mayers@imperial.ac.uk</a><span class="Apple-converted-space"> </span>wrote:<br><blockquote type="cite">On 12/07/13 11:34, Itamar Turner-Trauring wrote:<br><blockquote type="cite">Subclass twisted.internet.tcp.Client, override createInternetSocket() so<br>it calls setsockopt() on the socket after you've called base<br>implementation to create it. This breaks some abstraction boundaries, so<br>it isn't great, but very little code duplication is involved.<br></blockquote><br>Ah, ok. Presumably I also need to subclass Connector and override _makeTransport to use MyClient, then call MyConnector() directly (or subclass the reactor... shudder)<br><br>Should there be something built in to Twisted for this? Should I open a ticket?<br></blockquote><br>If you want your code to keep working, or to work with alternate reactor implementations, then you'd *really* rather use a documented, tested interface rather than the hack outlined above.<br></div></blockquote></div><br><div>Does such an API exist today, or should a ticket be filed for one?</div><div><br></div><div>For everyone's information, in case it's not entirely clear from the documentation resources available: we hope to eventually deprecate the whole 'tcp' module so that people (myself included ;-)) stop subclassing stuff in it, so writing new code that depends on this, even the nominally "public" parts of the API (the bits without underscores) would be really unfortunate.  If we can figure out something that uses totally public APIs without subclassing tcp.Client that would be best; if not, we should really have a ticket open to fix the API so that it is possible.</div><div><br></div><div>-glyph</div><div><br></div></body></html>