[Twisted-Python] Flush socket

Tobias Oberstein tobias.oberstein at tavendo.de
Fri Aug 12 08:18:42 EDT 2011


> > I do already disable Nagle by setting TCP NoDelay.
> >
> > And I do a reactor.select(0), which sometimes breaks I guess because
> > of reactor reentry not expected, and it will break when the reactor is
> > not select() based I guess.
> >
> > So the question is: is there an alternative to reactor.select(0) after
> > a transport.write() to make the reactor call write() on the underlying
> > socket for all stuff buffered within Twisted?
> 
> You should not be calling private reactor methods, it will break things.

? I know: therefor I was asking ..

> You can make the max write size (default 128 or 64kb, I forget) bigger by

I don't want to make it bigger, but smaller ..

> setting some attribute on the transport, but again, the OS will split things up
> across TCP packets however you want. This is not a very useful thing to
> attempt - better to instrument firefox to only do certain size reads.

What I am aiming at is a test suite for the WebSockets protocol which can
test (by fuzzing) _any_ WebSockets client.

For example, I've got a HTML file with embedded JavaScript which will
connect to the test server and run all test cases to get fuzzed.
That HTML works with any browser (that claims to support WebSockets).
I don't want to instrument 5 browsers;) At least for IE and Opera that would
not work anyway .. no source.



More information about the Twisted-Python mailing list