directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alex (JIRA)" <j...@apache.org>
Subject [jira] Commented: (DIRMINA-45) DemuxingProtocolCodecFactory.doDecode is called even after the buffer is empty.
Date Mon, 23 May 2005 06:51:51 GMT
     [ http://issues.apache.org/jira/browse/DIRMINA-45?page=comments#action_66044 ]
     
Alex commented on DIRMINA-45:
-----------------------------

This fix helped. Now I can send messages but only for awhile.

If I start sending them fast I still get that exception, sometimes on client, sometimes on
server.

java.lang.IllegalStateException: doDecode() can't return true when buffer is not consumed.
        at org.apache.mina.protocol.codec.CumulativeProtocolDecoder.decode(CumulativeProtocolDecoder.java:109)
        at org.apache.mina.protocol.io.IoAdapter$SessionHandlerAdapter.dataRead(IoAdapter.java:135)
        at org.apache.mina.io.AbstractIoFilterChain$2.dataRead(AbstractIoFilterChain.java:150)
        at org.apache.mina.io.AbstractIoFilterChain.callNextDataRead(AbstractIoFilterChain.java:364)

If my decode returns NEED_DATA it works fine no matter how fast client sends messages.

Alex

> DemuxingProtocolCodecFactory.doDecode is called even after the buffer is empty.
> -------------------------------------------------------------------------------
>
>          Key: DIRMINA-45
>          URL: http://issues.apache.org/jira/browse/DIRMINA-45
>      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:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Mime
View raw message