>
>
> So just override this method to get the event.
>
>
Yes, this is perfect and what I was looking for! much better then my first
approach and is working great!
Thanks again!
Marc
On 07/03/2022 17:45, Marc Boorshtein wrote:
A better solution would be to modify the Handler to catch the
sessionIdle event and check for how long the session was idling (the
event will be received every second)
When you say "modify the Handler", does that require a change to
Also note that we can get idling event for
- read
- write
- both
Ie if a session has not written for a specific period of time, an idle
event will be generated and transmitted for WRITE, and not for READ.
Also note that the event is at least generated once a second, but not
necessarily
>
>
>
> A better solution would be to modify the Handler to catch the
> sessionIdle event and check for how long the session was idling (the
> event will be received every second)
>
>
>
When you say "modify the Handler", does that require a change to Mina's
code? or is this something I can do
Hi Marc,
this is probably a bit overkilling, especially if you manage many sessions.
A better solution would be to modify the Handler to catch the
sessionIdle event and check for how long the session was idling (the
event will be received every second)
On 07/03/2022 16:28, Marc Boorshtein
Closing the loop, and hoping for a logic check to make sure my thinking is
correct. I was able to make this work by:
1. Creating an IoServiceListener on my acceptor
2. The IoServiceListener creates a Thread that iterates over all of the
IoSessions in the ManagedSessions map
if an
>
> Sounds quite a good feature to me.
>
>
>
Thanks for the detailed explanation. Am I able to implement this without
having to make a feature change to Mina? If you pointed me in the right
direction I'm sure I can figure it out but I really don't know where to
start.
Thanks
Marc
Hi,
the idle event is just informative. You have to handle it in your
Handler. Typically, everytime the idle event is received b-y the
handler, you increment a counter that is stored in teh IoSession
attribute. When this counter get higher to the value you have set, then
you can simple close