Hello,
I have an application that uses StreamIoHandler. The processStreamIo method
starts a new thread to handle the incoming data. This thread does something
like:
public void run() {
try {
while (true) {
Message message = null;
message = Decoder.decode(inputStream);
System.out.print(message);
}
} finally {
session.close();
}
}
The questions is how to break the thread loop when the session is closed.
The solution should also handle clients that send short messages, so that
the sessionClosed method is invoked before the thread is started and gets a
chance to decode the sent message.
Is there a better way within MINA to do that?
Thanks,
Zohar.