directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alex (JIRA)" <>
Subject [jira] Commented: (DIRMINA-45) DemuxingProtocolCodecFactory.doDecode is called even after the buffer is empty.
Date Tue, 24 May 2005 10:18:55 GMT
     [ ]
Alex commented on DIRMINA-45:

That's what I was trying to say: we need to do this kind of checking (remaining()<8). That's
fine. BTW, probably it is better to move it to decodable().

Still, something goes wrong. After awhile when buffer has more than one message I get that
exception: doDecode() can't return true when buffer is not consumed.

I don't understand how I get it because in every decode() I read more than one byte.
I print the buffer on the entry and exit of my decode() methods.

I can see like this:
entry - java.nio.DirectByteBuffer[pos=0 lim=52 cap=64]
exit - java.nio.DirectByteBuffer[pos=13 lim=52 cap=64]

So, pos has changed, why does it still give me that exception?


> DemuxingProtocolCodecFactory.doDecode is called even after the buffer is empty.
> -------------------------------------------------------------------------------
>          Key: DIRMINA-45
>          URL:
>      Project: Directory MINA
>         Type: Bug
>     Versions: 0.7.1
>  Environment: JDK1.4.2
>     Reporter: Alex
>     Assignee: Trustin Lee
>      Fix For: 0.7.2

> I am not sure if it is a bug or I just misunderstood something.
> I am implementing a protocol and use Demuxing* classes.
> When I return MessageDecoder.OK from my MessageDecoder's decode method, MINA tries repeatedly
calls this method again. If I return MessageDecoder.NEED_DATA everything goes fine.
> So, I would expect completely reversal behaviour.
> I checked CumulativeProtocolDecoder and DemuxingProtocolCodecFactory classes.
> In CumulativeProtocolDecoder.decode it says that doDecode is invoked repeatedly until
it returns false. Fine. But what "false" means here? I would guess that it means that buffer
was completely decoded and no more data is needed. But DemuxingProtocolCodedFactory.doDecode
returns true if decoder returned MessageDecoder.OK and false if decoder returned MessageDecoder.NEED_DATA.
Isn't wrong here?
> Alex

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:

View raw message