mina-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "李健" <jian...@jit.com.cn>
Subject How can i deal with the old [DataInputStream & DataOutputStream] client
Date Tue, 15 May 2007 09:04:38 GMT
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;
    // for response
    int resLen = dataInputStream.readInt();
    byte[] response = new byte[resLen];

    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!

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message