[Twisted-Python] Re: writing back to the connection is blocking my code

Phil Mayers p.mayers at imperial.ac.uk
Fri Mar 21 07:36:16 EDT 2008


coder_gus wrote:
> Well, by default the Nagle algorithm is turned off so it should transmit 
> the data asap. I don't think it's OS dependent.

It's only off if you've turned it off. It's on by default AFAIK on most 
OSes.

Anyway, Nagle is irrelevant - if the TCP window is closed i.e. you've 
sent N bytes and the far end has not acked, and N == window, your TCP 
stack WILL NOT (MUST NOT) send any more.

> 
> Toby Dickenson wrote:
>> coder_gus wrote:
>>
>>  
>>> Ok, this link answered a few of my questions (stupid of me that I
>>> haven't looked on that before I posted), but my question still stands:
>>> how do I send data to a client whenever I want from wherever I want and
>>> that data to be send as fast as possible,
>>>     
>>
>> The code in the faq that glyph pointed you to will do what you want, if I
>> understand your requirements correctly. Heres the link again:
>>
>> http://twistedmatrix.com/trac/wiki/FrequentlyAskedQuestions#HowdoImakeinputononeconnectionresultinoutputonanother 
>>
>>
>>  
>>> without the code waiting for the reactor to answer to some events?
>>>     
>>
>> Your transmission *might* have to wait if the operating system transmit
>> buffers are already full, and, if so, the reactor is the mechanism which
>> means your new data can wait without blocking the whole process.
>>
>>
>>
>>
>> _______________________________________________
>> Twisted-Python mailing list
>> Twisted-Python at twistedmatrix.com
>> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
>>
>> ____________________________________________________________________________________ 
>>
>> Save hundreds on an Unsecured Loan - Click here.
>> http://ads.lavabit.com/fc/REAK6bkM9e5ejOJrLUP0P44A0oQrI53GoIDlgN8VVyT8BnEAxlYQBU/ 
>>
>> ____________________________________________________________________________________ 
>>
>>   
> 
> 
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python





More information about the Twisted-Python mailing list