[Twisted-Python] How to see the number of received msgs?

Gabriel Rossetti gabriel.rossetti at arimaz.com
Wed Dec 10 02:27:17 EST 2008

Jean-Paul Calderone wrote:
> On Tue, 09 Dec 2008 17:12:32 +0100, Gabriel Rossetti 
> <gabriel.rossetti at arimaz.com> wrote:
>> tarjei wrote:
>>> Hash: SHA1
>>> Gabriel Rossetti wrote:
>>>> Hello eveyone,
>>>> is there a way to see how many msgs have been received and are waiting
>>>> to be processed by a client?
>>> Hi, I think you need to be far more specific if you want an answer.
>>> Which protocol is this for example?
>> TCP, but I assuming that Twisted gets stuff from the OS's buffer and 
>> puts it in it's own buffer, this may not be the case though, if it's 
>> not then my question makes no sense.
> The TCP transport implementation in Twisted calls the protocol's 
> dataReceived
> method *immediately* with any bytes it receives.  In other words, 
> received
> data is never buffered.  So the answer to your question is that the 
> number
> is always zero.
Ok, thank you.
> Additionally, TCP has no notion of messages.  There's just a stream of 
> bytes
> from which arbitrarily short or long sequences of bytes may be read.
yes, true.
> Jean-Paul

More information about the Twisted-Python mailing list