Closed Bug 286071 Opened 20 years ago Closed 9 years ago

AsyncWait of input stream of the socket (open as buffered) ignores requestedCount argument.

Categories

(Core :: Networking, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: bambas, Unassigned)

Details

(Keywords: helpwanted)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b2) Gecko/20050309 Firefox/1.0+
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b2) Gecko/20050309 Firefox/1.0+

I want to wait for some specific amount of data incoming to the accepted TCP
connection without reading them before. I use requestedCount parameter of
AsyncWait() method, but it is ignored and callback is given everytime even if
there is no new data in the stream. 

Reproducible: Always

Steps to Reproduce:
1. Accept new socket transport with @mozilla.org/network/server-socket;1.
2. Open input stream as buffered (one 65536B segment).
3. Use AsyncWait() on the input stream to wait for incoming data into the stream
or to notice it has been closed.

Actual Results:  
If I call AsyncWait() on the inputstream from OnInputStreamReady() callback and
I do not read the data from the stream I get OnInputStreamReady() over and over
again altought I use the requestedCount parameter of AsyncWait(). I wait for at
least one more byte (currently available + 1). To get the available value I use
Available() method of the stream.


Expected Results:  
Expected behavior is I get OnInputStreamReady() callback only when some more
data arives to the stream.
The reqeustedCount feature is not implemented yet.  I debated over this when
adding this API.  Other folks insisted that this API should exist even if not
implemented :-(

For now, I recommend working around the problem by creating a buffer.

I won't have any time to work on this for a while.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: helpwanted
Target Milestone: --- → Future
Assignee: darin → nobody
QA Contact: benc → networking
Target Milestone: Future → ---
requested is clear that it is just a guideline, not a promise
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.