dotgnu-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[DotGNU]tough bug in System.Xml (or Stream) with Jabber.net


From: Gopal V
Subject: [DotGNU]tough bug in System.Xml (or Stream) with Jabber.net
Date: Fri, 16 May 2003 04:04:52 +0530
User-agent: Mutt/1.2.5i

Hi All,
        This is a tough one ... suppose we endup with a conversational
xml protocol (say for instance jabber) ... And we assume that reading
data is a blocking method ... using a stream Jabber.net constructs .

XmlTextReader() tries to read data ... all goes well till we try to
read 4096 bytes of data off the stream ... First read gets 118 bytes 
of jabber.net <stream:stream . But the second Read() blocks , right ?

What happens is that the server end of things needs a response to the
first block of xml sent back here ...

ie I get a <stream:stream , and the server waits for Auth info ....
but the XmlTextReader blocks on the first part and the server does
not get the auth info and there fore no more data arrives ...

Do you get the picture ?.

The entire point of the discussion is ... buffered reader cannot 
operate on the assumption that it will have data available for 
each Read() .. Which means sawEOF is not nearly enough to stop
the buffer fill & reading operations. 

The issue can't even be solved with Threading as the Xml & stream reader
is in the same thread and will block the parsing of the tag ...

The point is if the Xml classes happen to use buffered reads at some
point of time , the jabber.net framework falls down ....

Apparently one solution is to buffer only till the next ">" , assuming
you'll be getting at least 1 XML tag for each ReadChars() in XmlStreamReader.
But that also is a crude assumption ...

Gopal
PS: I think this might be forwarded to Joe HildeBrand who might have
    some enlightenment to offer ... :-)
PPS: for those who need CONCRETE proof , here's the test or problem ..
-- 
The difference between insanity and genius is measured by success

Attachment: PipeStream.cs
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]