Re: Handling variable length request/response in MINA

2009-06-23 Thread Maarten Bosteels
It's in the javadocs: doDecode() is invoked repeatedly until it returns false So there is no need to have a loop in your doDecode implementation for decoding multiple messages.

Re: Handling variable length request/response in MINA

2009-06-23 Thread Emmanuel Lecharny
Maarten Bosteels wrote: It's in the javadocs: doDecode() is invoked repeatedly until it returns false So there is no need to have a loop in your doDecode implementation for decoding multiple messages.

Re: Handling variable length request/response in MINA

2009-06-23 Thread David Rosenstrauch
Maarten Bosteels wrote: It's in the javadocs: doDecode() is invoked repeatedly until it returns false So there is no need to have a loop in your doDecode implementation for decoding multiple messages.

Re: Handling variable length request/response in MINA

2009-06-23 Thread David Rosenstrauch
David Rosenstrauch wrote: Yongxing Wang wrote: I wrote a simple unit test case where one single buffer contains two messages, using the DummySession. After calling decode, it delivers me two messages: IoBuffer in = IoBuffer.wrap(bytesData); = contains two encoded msgs decoder.decode(session,

RE: Handling variable length request/response in MINA

2009-06-22 Thread Chowdhury, Shubhankar [WHQKA]
Of Emmanuel Lecharny Sent: Friday, June 19, 2009 5:46 PM To: users@mina.apache.org Subject: Re: Handling variable length request/response in MINA Chowdhury, Shubhankar [WHQKA] wrote: o o the whole format got garbled - let me try in plain text

RE: Handling variable length request/response in MINA

2009-06-22 Thread Chowdhury, Shubhankar [WHQKA]
[mailto:l.bolz...@gmail.com] Sent: Saturday, June 20, 2009 2:39 AM To: users@mina.apache.org Subject: Re: Handling variable length request/response in MINA 2009/6/20 Chowdhury, Shubhankar [WHQKA] shubhankar.chowdh...@united.com: The application would be a server listening to a port (TCP) and also would

Re: Handling variable length request/response in MINA

2009-06-22 Thread David Rosenstrauch
[mailto:elecha...@gmail.com] On Behalf Of Emmanuel Lecharny Sent: Friday, June 19, 2009 5:46 PM To: users@mina.apache.org Subject: Re: Handling variable length request/response in MINA Chowdhury, Shubhankar [WHQKA] wrote: o o the whole format got garbled - let me try in plain text

RE: Handling variable length request/response in MINA

2009-06-22 Thread Chowdhury, Shubhankar [WHQKA]
- From: David Rosenstrauch [mailto:dar...@darose.net] Sent: Monday, June 22, 2009 10:53 AM To: users@mina.apache.org Subject: Re: Handling variable length request/response in MINA I do something similar, using a binary protocol where messages vary in length based on data-length values

Re: Handling variable length request/response in MINA

2009-06-22 Thread Emmanuel Lecharny
David Rosenstrauch wrote: I do something similar, using a binary protocol where messages vary in length based on data-length values in the message. And yes, I use a custom subclass of CumulativeProtocolDecoder for this. The code's a bit ugly, but it works. Essentially your decoder needs to

Re: Handling variable length request/response in MINA

2009-06-22 Thread David Rosenstrauch
Emmanuel Lecharny wrote: David Rosenstrauch wrote: I do something similar, using a binary protocol where messages vary in length based on data-length values in the message. And yes, I use a custom subclass of CumulativeProtocolDecoder for this. The code's a bit ugly, but it works.

Re: Handling variable length request/response in MINA

2009-06-22 Thread Emmanuel Lecharny
variable length request/response in MINA Chowdhury, Shubhankar [WHQKA] wrote: o o the whole format got garbled - let me try in plain text -- -- This might be a very dumb post but please

Re: Handling variable length request/response in MINA

2009-06-22 Thread Emmanuel Lecharny
David Rosenstrauch wrote: I would add a forth case : * more than one complete message in a single buffer. In this case, you have to loop until you have decoded all the messages, calling the next filter for each decoded message. This is what we do in Apache Directory to decode LDAP requests.

Re: Handling variable length request/response in MINA

2009-06-22 Thread boB Gage
variable length request/response in MINA Chowdhury, Shubhankar [WHQKA] wrote: o o the whole format got garbled - let me try in plain text -- -- This might be a very dumb post but please

RE: Handling variable length request/response in MINA

2009-06-22 Thread Yongxing Wang
] On Behalf Of Emmanuel Lecharny Sent: Monday, June 22, 2009 9:27 AM To: users@mina.apache.org Subject: Re: Handling variable length request/response in MINA David Rosenstrauch wrote: I do something similar, using a binary protocol where messages vary in length based on data-length values

Re: Handling variable length request/response in MINA

2009-06-22 Thread David Rosenstrauch
David Rosenstrauch wrote: Emmanuel Lecharny wrote: I would add a forth case : * more than one complete message in a single buffer. In this case, you have to loop until you have decoded all the messages, calling the next filter for each decoded message. This is what we do in Apache Directory

Re: Handling variable length request/response in MINA

2009-06-22 Thread Emmanuel Lecharny
David Rosenstrauch wrote: David Rosenstrauch wrote: Emmanuel Lecharny wrote: I would add a forth case : * more than one complete message in a single buffer. In this case, you have to loop until you have decoded all the messages, calling the next filter for each decoded message. This is

Re: Handling variable length request/response in MINA

2009-06-22 Thread David Rosenstrauch
Emmanuel Lecharny wrote: David Rosenstrauch wrote: David Rosenstrauch wrote: Emmanuel Lecharny wrote: I would add a forth case : * more than one complete message in a single buffer. In this case, you have to loop until you have decoded all the messages, calling the next filter for each

Re: Handling variable length request/response in MINA

2009-06-22 Thread Emmanuel Lecharny
Yongxing Wang wrote: If not implicitly covered in the case of more than one complete message in a single buffer, we also need to deal with the case where a sing buffer contains several complete messages AND an incomplete one. if fact, all the cases are listed here : * a buffer with an

Re: Handling variable length request/response in MINA

2009-06-22 Thread Emmanuel Lecharny
David Rosenstrauch wrote: DR Hmmm ... yeah, that's a problem. I'll have to fix this. Thanks for the heads up. Just keep me informed if this is not anymore a problem... May be we should document this kind of decoding on the web site too... It can e helpfull ! DR -- -- cordialement,

RE: Handling variable length request/response in MINA

2009-06-22 Thread Yongxing Wang
: Re: Handling variable length request/response in MINA David Rosenstrauch wrote: DR Hmmm ... yeah, that's a problem. I'll have to fix this. Thanks for the heads up. Just keep me informed if this is not anymore a problem... May be we should document this kind of decoding on the web site too

Re: Handling variable length request/response in MINA

2009-06-22 Thread Emmanuel Lecharny
Yongxing Wang wrote: I wrote a simple unit test case where one single buffer contains two messages, using the DummySession. After calling decode, it delivers me two messages: IoBuffer in = IoBuffer.wrap(bytesData); = contains two encoded msgs decoder.decode(session, in,

Re: Handling variable length request/response in MINA

2009-06-22 Thread David Rosenstrauch
Yongxing Wang wrote: I wrote a simple unit test case where one single buffer contains two messages, using the DummySession. After calling decode, it delivers me two messages: IoBuffer in = IoBuffer.wrap(bytesData); = contains two encoded msgs decoder.decode(session, in,

Re: Handling variable length request/response in MINA

2009-06-20 Thread Lorenzo Bolzani
2009/6/20 Chowdhury, Shubhankar [WHQKA] shubhankar.chowdh...@united.com: The application would be a server listening to a port (TCP) and also would return back some response based on the type field. So the client would initiate by sending a login-request - in response we have to send accept

Handling variable length request/response in MINA

2009-06-19 Thread Chowdhury, Shubhankar [WHQKA]
Hello, This might be a very dumb post but please help. I have already used MINA for a few projects mainly using the CumulativeProtocolDecoder and RequestResponseFilter for the client applications and using TextlineCodec for a few server instances. But my next attempt is a bit complex

RE: Handling variable length request/response in MINA

2009-06-19 Thread Chowdhury, Shubhankar [WHQKA]
in this regard is really appreciated. Thanks, Shubhankar 847-700-4452 -Original Message- From: Chowdhury, Shubhankar [WHQKA] [mailto:shubhankar.chowdh...@united.com] Sent: Friday, June 19, 2009 5:16 PM To: users@mina.apache.org Subject: Handling variable length request/response in MINA Hello

Re: Handling variable length request/response in MINA

2009-06-19 Thread Emmanuel Lecharny
Chowdhury, Shubhankar [WHQKA] wrote: o o the whole format got garbled - let me try in plain text -- -- This might be a very dumb post but please help. I have already used MINA for