mina-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chowdhury, Shubhankar [WHQKA]" <Shubhankar.Chowdh...@united.com>
Subject RE: Handling variable length request/response in MINA
Date Fri, 19 Jun 2009 22:23:37 GMT
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 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 where the data that comes is a structured
data of variable length basically of the following format-

Offset-LengthInByte-FieldName
------------------------------
0-8-application_id
8-2-Version
10-2-Type
12-2-message_id_number
14-2-Data_length
16-4-Reserved
20-data_length-Data

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" or "reject", then the data would be flowing, then log-out,
keep-alive etc and all of them would follow the above structure.

 

How do I handle this using MINA? Is there anyway I can use the
CumulativeProtocolDecoder?

 

Any help in this regard is really appreciated.

Thanks,
Shubhankar
847-700-4452

-----Original Message-----
From: Chowdhury, Shubhankar [WHQKA]
[mailto:Shubhankar.Chowdhury@united.com] 
Sent: Friday, June 19, 2009 5:16 PM
To: users@mina.apache.org
Subject: Handling variable length request/response in MINA

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 where the data that comes is a structured
data of variable length basically of the following format. 

 

Offset

Length in Byte

Field Name

0

8

Appl_id

8

2

Version

10

2

Type

12

2

Message_id_number

14

2

Data_length

16

4

Reserved

20

Data_length

Data

 

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" or "reject", then the data would be flowing, then log-out,
keep-alive etc and all of them would follow the above structure.

 

How do I handle this using MINA? Is there anyway I can use the
CumulativeProtocolDecoder?

 

Any help in this regard is really appreciated.

 

Thanks,

Shubhankar

 

 

 





Mime
View raw message