[Twisted-Python] Setting socket options before connect
exarkun at twistedmatrix.com
exarkun at twistedmatrix.com
Fri Jul 12 06:09:43 MDT 2013
On 10:42 am, p.mayers at imperial.ac.uk wrote:
>On 12/07/13 11:34, Itamar Turner-Trauring wrote:
>>Subclass twisted.internet.tcp.Client, override createInternetSocket()
>>so
>>it calls setsockopt() on the socket after you've called base
>>implementation to create it. This breaks some abstraction boundaries,
>>so
>>it isn't great, but very little code duplication is involved.
>
>Ah, ok. Presumably I also need to subclass Connector and override
>_makeTransport to use MyClient, then call MyConnector() directly (or
>subclass the reactor... shudder)
>
>Should there be something built in to Twisted for this? Should I open a
>ticket?
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.
Jean-Paul
More information about the Twisted-Python
mailing list