Hello,
I am using MINA in a UDP application. My IOHandler's messageReceived()
method has a org.apache.mina.common.ByteBuffer object as the message.
I am modifying the ByteBuffer with the response message and sending using
the session.write(buf) call.
However this throws an Exception with the message "Already released buffer.
You released the buffer too many times."
If I call buf.aquire() before the session.write() call, I do not get this
exception.
I added log messages to buf.aquire() and buf.release() methods and found that
the count was 1 and after calling session.write(buf) the buffer is released 2
times.Therefore calling aquire() before calling session.write(buf) solved the
problem.
Is this a safe assumption to make for using the ByteBuffer.
Are there other places within MINA code where release() may be called in other
situations when session.write(buf) is called.
Thanks,
Arun kumar
---------------------------------
Heres a new way to find what you're looking for - Yahoo! Answers