Re: compressed data from an asynchronous socket !!

[email protected]
Newsgroups gmane.network.gnutella.devel
Organization Home, Grenoble, France
Message-ID <[email protected]>
Quoting mark W <[email protected]> from ml.gnutella.dev-forum:
:If I buffer all asynchronous data from the session and pass synchronously it to
:SharpZipLib inflater,e.g.
:
:InflaterInputStream str = new InflaterInputStream (memStream) ;
:int i = str.Read(OutBuffer, 0, BytesInBuffer) ;  
:
:but due to the permanent connection, eventually I will eat up all my memory. 

Of course.  The total amount of data sent during a "session" is potentially
infinite (say, very large, larger than any amount of RAM you can come up with).

What does this mean?  It means you're approaching the problem from the
wrong angle.

:In another way , if I pass asynchronous buffer to above inflater(whenever data
:arrived at socket), it will throw an exception of invalid header or checksum. 

Hehe.  This means you still haven't figured how to do this, despite the
hint I gave you earlier (remember: it's a continuous stream of data).

You can't go forward until you figure this one out.  And note the fix is
trivial (I saw the problem immediately in the code snippet you posted) but
not being able to see it means you won't be able to continue your task.

Go back to the eariler problem and make it work first.  Then you'll see
that your current problem will be fixed as well and everything should be
crystal clear then.

Raphael
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.