I think you have to write your own decoder class to reassemly the whole
message. The good starting point is to take a look at sumup example. It
really helps.
2007/5/15, 李健 <[EMAIL PROTECTED]>:
Hi, All
i wanna to use MINA to improve my ApplicationServer, the old
application's socket part is developed using DataInputStream &
DataOutputStream in both server and client side. we wrote data package
length at the begining for ervry request and response data. the code looks
like this
// for request
byte [] request = ...
int reqLen = request.length;
dataOutputStream.writeInt(reqLen);
dataOutputStream.write(request);
dataOutputStream.flush();
...
// for response
int resLen = dataInputStream.readInt();
byte[] response = new byte[resLen];
dataInputStream.read(response);
...
i'v tried to use MINA to handle the request sent by my old clients(the
clients have been deployed in many area and CodeChanging is forbidden),
because of the noblocking of NIO, when one client calls writeInt(), write(),
flush() methods orderly, my IoHandler would recevie data partly in many
times. so in IoHandler.messageRecevied(), it couldn't get the whole
request data to do the business logic.
who can give me some advice to handle tihs?
Best Regard!
LJ
2007-05-15