Christian Eyrich wrote:

Hi,

I'd like to have a way to flush a streams buffer.

There are sometimes bytes hanging around in the buffer though I don't
need them. To fix some problems I'd like to get rid of those bytes right
before sending the next command in the POP3 protocol handler.

One way is to loop with Read() until no bytes available. But since it
would be executed quite often I want to avoid this construct.

I'm speaking of mAsyncStream that's a nsIAsyncInputStream handed over as
a nsIInputStream at nsInputStreamPump.cpp#435

I found the interfaces of the InputStreams and there's no flush method.
But maybe it's implemented but not made available. Or there's another way.

Christian
_______________________________________________
Mozilla-netlib mailing list
[EMAIL PROTECTED]
http://mail.mozilla.org/listinfo/mozilla-netlib



Hmm... a nsIInputStreamPump should automatically push all of the data to
you. That's just what it does. Perhaps it is the case that there is a PLEvent
in the queue that will call your OnDataAvailable? In other words, if you
were to wait a little while, perhaps you would get your last
OnDataAvailable event?


Are the remaining bytes predictable?  Are they part of the POP3 protocol,
or are they just a few random bytes?  Can you modify the POP3 stream
listener to read to the last byte of data before it processes the data?

-Darin
_______________________________________________
Mozilla-netlib mailing list
[EMAIL PROTECTED]
http://mail.mozilla.org/listinfo/mozilla-netlib

Reply via email to