In ClientSessionHandler
public void messageReceived(IoSession session, Object message) {
// server only sends ResultMessage. otherwise, we will have to
identify
// its type using instanceof operator.
ResultMessage rm = (ResultMessage) message;
if (rm.isOk()) {
// server returned OK code.
// if received the result message which has the last sequence
// number,
if (rm.getSequence() == values.length - 1) {
// print the sum and disconnect.
//System.out.println("The sum: " + rm.getValue());
for (int i = 0; i < values.length; i++) {
AddMessage m = new AddMessage();
m.setSequence(i);
m.setValue(values[i]);
session.write(m);
}
try
{
Thread.sleep(500);
} catch (InterruptedException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
//session.close();
//finished = true;
}
} else {
// seever returned error code because of overflow, etc.
SessionLog.warn(session, "Server error, disconnecting...");
session.close();
finished = true;
}
}
On 8/7/07, Trustin Lee <[EMAIL PROTECTED]> wrote:
>
> On 8/7/07, mat <[EMAIL PROTECTED]> wrote:
> > It normally takes 1 or 2 days to get OOM on my server. However, memory
> leak
> > does happen as you can see. Since I can't wait OOM until it happens, I
> just
> > simply modify the Sumupserver example to prove the memory leak may
> caused by
> > mina core. (I assume sumupserver has no memory leak itself)
>
> What modification did you make? Please provide us full patch so we
> can reproduce the problem by ourselves.
>
> Trustin
> --
> what we call human nature is actually human habit
> --
> http://gleamynode.net/
> --
> PGP Key ID: 0x0255ECA6
>