lnaber wrote:
>
>
> Tuure Laurinolli-2 wrote:
>>
>>
>>>Are there *any* rules that allow detection of message boundaries? For
>>>example, is there a time interval between messages? Is a message always
>>>sent in a single IP packet, and is there enough knowledge of the
>>>underlying protocol stack to assume that there will be no fragmentation?
>>
>>>If there is a time interval between messages, you could probably start a
>>>timer when data is received, buffering the data received until the timer
>>>fires, and then pass the buffered data onwards.
>>
>>
>
> The application is conversational in that a request-response is expected
> so yes, there is timing available.
>
> I like the time interval idea but I'm not sure how to insert that into the
> MINA objects (session, filter) life cycle events. Potentially the
> session's
> idle timer could be used to detect message boundaries but how does
> one insert that back into the CumulativeProtocolDecoder's event to
> process and complete the message flow through the filter stack?
>
Is it possible to set & reset the session idle timer during operation? For
detecting a subset of messages that fall into the scenario described earlier
it would be good to timeout very quickly (100 ms) but that would not be the
optimal setting for the overall operation. So the CumulativeProtocolDecoder
subclass could, when it detected the fragmented message, set the timer very
short until the fragment is located, then set the timer back to a more
reasonable value.
--
View this message in context:
http://www.nabble.com/CumulativeProtocolDecoder-tp18777497p18829198.html
Sent from the Apache MINA User Forum mailing list archive at Nabble.com.