<br><br><div class="gmail_quote">On Wed, Dec 12, 2012 at 8:22 AM, Michael Schlenker <span dir="ltr">&lt;<a href="mailto:msc@contact.de" target="_blank">msc@contact.de</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
<br>
i use twisted for some volume streaming over fat pipes (10 GE) and need<br>
to tweak the rcv and send buffer sizes when streaming via<br>
socket.setsockopt(). Otherwise Twisted spends lots of time calling the<br>
producer with tiny blocksizes and writing those tiny buffers to the tiny<br>
OS buffer. Speedup for streaming was around 40x when using a large<br>
buffer instead of default block and buffer sizes, so this is really needed.<br>
<br>
I&#39;m using Twisted 12.2.<br>
<br>
It works fine when using reactor.listenTCP(), but fails when using<br>
reactor.listenSSL() because transport.getHandle() does not return a<br>
socket object in that case (i get some SSL.Connection object instead).<br></blockquote></div><br clear="all">Probably the thing to do is listenTCP() rather than listenSSL(), and then:<br><br>class YourProtocol(BaseProtocol):<br>
    def connectionMade(self):<br>        self.transport.getHandle().setsockopt(...)<br>        self.transport.startTLS(contextFactory)<br>        BaseProtocol.connectionMade(self)<br><br>Ideally, of course, Twisted would have an API for changing the producer/consumer buffer sizes and corresponding OS buffers.<br>
<br>-- <br>Itamar Turner-Trauring, Future Foundries LLC<br><a href="http://futurefoundries.com/" target="_blank">http://futurefoundries.com/</a> — Twisted consulting, training and support.<br><br>