> So just send the first chunk in the messageReceived() method, and in the > messageSent() method, send the following chunks as you receive the 'SENT' > event.
:-)))) Cooooooool! One more question, Emmanuel.. If the response comes from a FileChannel, how do I coerce a call to FileChannel.transferTo on the socket? -Babak On Wed, Mar 25, 2009 at 4:00 AM, Emmanuel Lecharny <[email protected]> wrote: > Babak Farhang wrote: >>> >>> for ( int i = 0; i < yourData.lengh; i+=10000 ) { >>> byte[] temp = new byte[100000]; >>> System.arrayCopy( yourData, i, temp, 0, 10000); >>> session.write( temp ); >>> } >>> >> >> If session.write(temp) doesn't block, then we might end up having >> written all 100K into memory before anything was written to the >> socket. No? >> >> I was thinking maybe there's a way to write a 10K chunk, and have MINA >> callback me back when it's finished writing it, so that I can write >> the next 10K chunk, and so on, until the whole message is written. >> > > So just send the first chunk in the messageReceived() method, and in the > messageSent() method, send the following chunks as you receive the 'SENT' > event. > > -- > -- > cordialement, regards, > Emmanuel Lécharny > www.iktek.com > directory.apache.org > > >
